Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I'm trying to compare our Nr of cases to the volume we had in 2019.
In order to do a day to day and MTD comparison, I need to place the measure in a table like this, using 'Date'[Date] from my Canlendar table in rows.
My issue is that using the measure below, the results are correct when I don't have any selection in a Year slicer, but it returns blanks when I select 2022
NrCases_2019 =
CALCULATE (
[NrCases], //Obs. This measure is just a COUNTROWS from my cases table
FILTER (
ALL ( 'Date'[Calendar Month], 'Date'[Calendar Year] ),
'Date'[Calendar Year] = "2019"
)
)How can I ignore all filters and return the volume from 2019 in this situation?
I found this post with a solution from @amitchandak but the need seem to be slightly different Solved: How can I compare a CONSTANT year (i.e 2019) with ... - Microsoft Power BI Community
Thank you in advance
Solved! Go to Solution.
@johnt75 thanks for the suggestion, I couldn't make it work like this.
@amitchandak this one did it for me. It was a clever and simple way to solve it.
Thanks a lot both of you!
Revert back to the DAX you originally had and then check exactly which filters are being applied both when you have 2022 selected in a slicer and when you don't.
If you open the Performance Analyzer from the View ribbon then you can start recording and refresh visuals. Copy the query from the appropriate visual and paste it into DAX Studio. That should show you exactly which columns are being used as filters and you can then include or exclude them from your 2019 measure as appropriate
Change the ALL line in your filter to be
ALL('Date'),There may be filters being applied to other columns than the ones you specified, e.g. a sort column used by [Month].
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |