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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Change Measure based on Slicer Value

I have a table that contains YTD, MTD, WTD, and 2019

 

I want to write a formula that when the user selects YTD, MTD, or WTD on the slicer it displays the measure 2020 Outlet Status, when a user selects 2019 on the Slicer is displays another Measure 2019 Outlet Status. 

 

Basically I just need 

IF('Period Select'[Period Select]= "2019"

then [2019 Outlet Status]

ELSE [2020 Outlet Status]

END

 

Im having an issue becuase I am not calculating anything- its just classifying outlets. 

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
If MTD YTD WTD and 2019 are 4 columns, you would need to create a new slicer table name it as slicer column.slicer column.JPG

 

Measure = IF(SELECTEDVALUE('Slicer Table'[Slicer Column])="2019",[2019 Outlet Status],[2020 Outlet Status])

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 
If MTD YTD WTD and 2019 are 4 columns, you would need to create a new slicer table name it as slicer column.slicer column.JPG

 

Measure = IF(SELECTEDVALUE('Slicer Table'[Slicer Column])="2019",[2019 Outlet Status],[2020 Outlet Status])

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You have try very similar to what have been done here

https://community.powerbi.com/t5/Community-Blog/Display-Label-Only-on-the-Last-Data-Point-of-the-Line-Visual-for/ba-p/1253464

or

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.