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.
Hello,
I have a data set with date such as Jun 1 - Yesterday, I would like to have a slicer with two option, Yesterday / MTD.
How could I do that?
Thanks!
Solved! Go to Solution.
@Anonymous,
Do you want to use a slicer to choose which measure(Yesterday or MTD) to display? If so, create a new table containing the measure name like below.
Then create the following similar measures in your original table, please note that there is no relationship between the new table and your original table.
salesMTD = TOTALMTD(SUM(Table6[Amount]),Table6[Date])
salesYesterday = CALCULATE(SUM(Table6[Amount]),FILTER(Table6,Table6[Date]=TODAY()-1))
selected measure1 = IF(HASONEVALUE(Table7[Measure]),SWITCH(FIRSTNONBLANK(Table7[Measure],Table7[Measure]),"Yesterday",[salesYesterday],"MTD",[salesMTD]),blank())
Reference:
http://breaking-bi.blogspot.sg/2016/06/power-bipowerpivot-using-slicers-to.html
Regards,
Lydia Zhang
@Anonymous,
Do you want to use a slicer to choose which measure(Yesterday or MTD) to display? If so, create a new table containing the measure name like below.
Then create the following similar measures in your original table, please note that there is no relationship between the new table and your original table.
salesMTD = TOTALMTD(SUM(Table6[Amount]),Table6[Date])
salesYesterday = CALCULATE(SUM(Table6[Amount]),FILTER(Table6,Table6[Date]=TODAY()-1))
selected measure1 = IF(HASONEVALUE(Table7[Measure]),SWITCH(FIRSTNONBLANK(Table7[Measure],Table7[Measure]),"Yesterday",[salesYesterday],"MTD",[salesMTD]),blank())
Reference:
http://breaking-bi.blogspot.sg/2016/06/power-bipowerpivot-using-slicers-to.html
Regards,
Lydia Zhang
quick and dirty use calculated column with SWITCH or IF
not that beautiful though but if the data refreshes regularly and the refresh performance isnt an issue thats fine
if you dont want that build good time intelligence for your model theres tutorials
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 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |