Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Need help!
I'm trying to create a report showing different facts for current year with some last year comparisons (in this example SamePeriodLastYear is used or simplification). The aim is to let the end user through a slicer (list) choose between different cusomized date periods, such as for example "Last week, Week to Date, Last 3 days" etc (about 20 different pre-defined periods). So the aim is to not need to use the Relative view in the standard slicer, as it does not provide all needed periods, and when using that method the user needs to manually enter different combinations which is not optimal.
The big challenge for me is that the data for last year is not showing when choosing a period from a period dimension table. It only works when I enter periods through a slicer containing dates from the date dimension table (using visualization "Slicer" and setting Relative).
In my simplified example pbix the relationships looks as follows:
To get the filtering of custom periods to filter the dates, the DIM-Periods table needs to be set to bidirectional in the cross filter direction in its relationship to the DIM-Dates. Otherwise filtering periods will have no impact on dates and facts.
When filtering the date dimension the "manual" way using dates from table DIM-Dates, it works ok:
But when using the Period filter with data from table DIM-Periods the LY gets blank:
I have tried to setup period dimension tables both through M and DAX, both learned from this post: https://blog.crossjoin.co.uk/2016/05/30/creating-current-day-week-month-and-year-reports-in-power-bi... But same challenge both ways as the outcome to table DIM-Periods gets the same.
In this example I'm using the DAX version, which says:
Solved! Go to Solution.
You may apply virtual relationship in DAX measure.
You may apply virtual relationship in DAX measure.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |