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.
Hi Friends,
I have an year slicer in my report which is like this.
and a date slicer in my report which looks something like this. the below slicer is dependent on the above year slicer.
So I want to create 2 cards the one card shows the data for the time selected in the slicer and the other shows the data for the previous year of that slicer.
For E.g.-: If in my slicer the date selected is from 19-02-2016 to 25-04-2016 so one of the card should display the data of the time slected and the other card should display the data for the previous year of the same time like it should display the data for 19-02-2015 to 25-04-2015
so whatever the the selection is done in the slicer the (Current Year) card will show the data of that very time period and (Last Year) card will show the data of previous year for the same date and month but date will change.
Solved! Go to Solution.
Seems like that would be SAMEPERIODLASTYEAR function:
https://msdn.microsoft.com/en-us/library/ee634972.aspx
Seems like that would be SAMEPERIODLASTYEAR function:
https://msdn.microsoft.com/en-us/library/ee634972.aspx
@Greg_DecklerI want to display the previous year value for the time range that has been selected in the timeline slicer. Can you suggest me DAX for it
@afaque03 wrote:
@Greg_DecklerI want to display the previous year value for the time range that has been selected in the timeline slicer. Can you suggest me DAX for it
Supposing there's a calendar table in your case, if the currentYear measure is as
currentYear = SUM(yourTable[value])
Then a measure for previous year shall work
previousYear = CALCULATE([currentYear],SAMEPERIODLASTYEAR('calendar'[Date]))
However my concern is about the interaction between those slicers, per my test, the dates slicer in your case won't reflect according to the Year slicer.
@Eric_ZhangSAMEPERIODLASTYEAR function worked for me but the issue is if i put any other filter in that report and select that filter the card does not populate any data. The card does not display.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |