Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Field Parameters to Toggle Entire Dashboard Between Date Ranges

Current State: we have a slicer that toggles all measures on a dashboard to show either TYD or MTD for the date range selected - the date range uses a date hierarchy for year and month. Every measure has a SWITCH() statement to calculate the YTD/MTD depending on what is selected in that slicer (see example in screenshot  below for calculating Net Sales)

  • Ex. All of 2021 + 2022 through April is selected on the Date slicer, and MTD is selected in the Time Selection slicer. The measures then filter to include April 2022 data only.  Toggle the YTD/MTD slicer to show YTD and all of the measures will then show 2022 through April only. If a user then includes June of 2022 on the Date slicer, the YTD will include the data available through June for the entire year, and the MTD will include only June 2022.

Desired State: a Field Parameter that users can toggle for YTD/MTD that changes EVERY measure on the entire canvas for all visuals WITHOUT using SWITCH() statements.


NS.jpg

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create two measures MTD and YTD and use that in field parameters

 

Field Parameters- One solution for Measure Dimension slicer: https://youtu.be/lqF3Wa1FllE?t=70

Anonymous
Not applicable

Hi Amit,
The problem is that I basically need a MTD/YTD slicer for all measures on the entire canvas using field parameters instead of embedding SWITCH() statements into every measure. The screenshot is just showing one measure for this dashboard, however, there are 6 KPIs that would need to change based on the field MTD/YTD parameter selection across the entire dashboard. Is this even possible? 

I did create two measures to get the last day of the month selected and one for the last day of the year selected and put those into field parameters however it's not filtering the data any further than the Date Hierarchy slicer does already. 

YTD= YEAR(LASTDATE('Date'[Date]) )

MTD = MONTH(LASTDATE('Date'[Date]) )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.