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
hidenseek9
Post Patron
Post Patron

Switch True DAX to select data to show

Hello Power BI Community, 

 

I would like to use Switch True DAX to select metric to show the necessary data depending on the needs.

For instance, if a user selects "Sales", the dashboard will show the sales data

and if the user selects "Costs", the dashboard will show the cost data. 

 

Please refer to below YouTube video and this is exactly what I would like to do.

Switch True Measure Video 

 

I understand how to set up Switch True DAX from this video, but what I do not understand is 

how this guy set up [metrics selected] measure. 

2020-02-15 04_14_26-Window.png

 

Can anyone guess how to set up this measure?

 

Thanks,

H

1 ACCEPTED SOLUTION
VasTg
Memorable Member
Memorable Member

@hidenseek9 

 

Refer to these posts.

 

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

 

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn

View solution in original post

2 REPLIES 2
VasTg
Memorable Member
Memorable Member

@hidenseek9 

 

Refer to these posts.

 

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

 

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn
VasTg
Memorable Member
Memorable Member

@hidenseek9 

 

Create a table as below with values as Sales, Costs, etc and use them as a slicer. 

 

 

Sales

Costs

 

In your switch measure, use a variable to get the selected value and use in place of "Metric Selected"

 

Var selected_value = SELECTEDVALUE(COLUMN)  //Slicer column)

 

 

If it helps mark it as a solution

Kudos are nice too

Connect on LinkedIn

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.