Power BI Comparative sales report - powerbi

I have to prepare a stacked column chart with two bar. One will be fixed - Last day of last financial year. Another will show latest date when not selected. Alternately, I want to select from date slicer drop down with any previous date of current year and compare it with last FY end date Sale. So, when the date will be changed in slicer, it will only change one bar, while last FY bar should remain unchanged.

It could be better if you provide some more details with your current approach..
If I have to guess then you probably you need 2 measures,
Create a Measure which dynamically calculate last year FY last date Fact (Sales, Inventories etc...)
Create a Measure which is using current year date to calculate (This has to be same date or related date which you are considering
for your slicer)
Then you can use these 2 measure values in Stack chart,
Remember your first measure remains static throughout current year but second measure change as per your date selection.
I hope it helps!!

Related

How can I display months without no data?

I follow the following blog http://sqljason.com/2018/03/display-last-n-months-selected-month-using-single-date-dimension-in-powe... in order to display Display Last N Months & Selected Month using Single Date Dimension in Power BI.
I've an issue when trying to display month-year when there is no data in the fact table sales.
I did modification: https://1drv.ms/u/s!Amd7BXzYs7AVg3xJ1MKPYI_PIw3z
How to show to show for example October, november and december 2015 as an example?
I downloaded your PBIX file and looked through it.
I am unsure what you exactly want to see, because your report has a few quirks in it.
I'll try to sum them up:
You have a 'select month' drop down menu ánd a slider for selecting the number of months (As 'sales for last x months). This doesn't work. Since you now need to manually select the wanted months in the drop down menu with CTRL+Click (On each month) ánd you need to use the slider.
Next to that, your calculations seem to be wrong. If I only select Dec-16 I get 70. If I select Nov-16 and Dec-16, the sales in Dec-16 suddenly become 70 and Nov-16 takes over. If I select until July-16, July-16 gets 70 and Dec-16 gets 120.. I don't know if this is how you want it but it looks like strange behaviour.
A good tip for measures. If you sum, divide or do any calculation. End with +0. That way you wont see (Blank) but 0. E.g.
Sales (Selected Month) = SUM(Sales[Sales]) + 0
Also, you have made a small date table, which is good. But you don't use this consistently through your report. For selecting months you use the date table and for the graph you use the date in the sales table. It is better to use the date table for dates, since that is it's sole purpose.

Show all data for month to date

In Power BI, I am creating a grid to show specific data in a time period. I want the grid to update everyday to show the data corresponding month to date. I want my data to represent 9/7 - 10/7 and tomorrow I want it to update to show 9/8-10/8. Essentially I want a measure in DAX to display all data from month to date.
You can do this from relative date filter in the right side tabs,
Select visualization and their is filter for date,
try with above method.

Change shared axis/hierarchy based on date slicer

I am having some trouble dynamically altering my x-axis based on a custom date slicer.
Basically it works fine if the end-user is looking at every single date between 2020 and 2021, however, if the end-user filters to just a couple months, I want the column chart to skip the Year and just jump to the MonthYear axis to remove the user having to start from the year then drill down to see the months.
Similarly, if it was just days filtered in the slicer it should jump to the Date axis rather than drilling down from Year then to MonthYear then finally to Date.
How would I go about doing this?
Date Slicer:
Stacked Column Chart:
Shared Axis:

power bi year over year comparison and line chart

I want a custom table/matrix in power bi displaying the year over year data and also a line chart displaying the same. i have all the year information in one column i.e both 2018 and 2019 data in one column. I want to perform an aggregate operation on another column and make the comparison for each of the month in the previous year
The checkout date column has all the date information for both years. The caring attitude column has the data for which i want to perform aggregation based on month
This is how i want the data to be displayed in the power bi
This is the line chart i want. Year over Year comparison of those values
In Excel I manually add the goal values in the rows and then create a graph
*for the former you just need to have date(years) as your rows date(months) as columns and caring attitude of staff as your values(this need to be done in a matrix visual and date should have hierarchy).
* for the latter date(months) as axis, date(years) as legend and caring attitude of staff as your values(for line chart).

How can I get the number of days by month from a slicer in Power BI?

I just want to select a range of days in a slicer and show in a table the number of days for each month/period (month-year).
I used DAX to create a table with the information I need and I don't have problems with the periods (first column), it changes dinamically, the problem is the column "Days" (second column) because it's always showing the total number of days for each month.
Here my DAX code
SelectedPeriods = GROUPBY(DimDate;DimDate[Period];"Days";COUNTX(CURRENTGROUP();DimDate[DateKey]))
Here the result
What I expect is:
2 for april, 31 for may, 1 for june
This is an issue with execution order.
SelectedPeriods = GROUPBY(DimDate;DimDate[Period];"Days";COUNTX(CURRENTGROUP();DimDate[DateKey]))
Generates a calculated table. These are calculated when the data model is refreshed and stored in it. They are not refreshed each time a connected dimension is changed within a dashboard.
In your case, while changing date filters may hide rows from this table the number of days remains fixed at the number calculated initially when there was no filter context on the data i.e. counting all days in the month.
If you want the result to change then you need to use a measure instead of a calculated table. Measures react to the current filter context within the report and so will adjust their output each time a slicer is changed.
The needed measure will depend on your model but might be something as simple as:
CountOfDays := CountRows(DimDate)