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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Lim_Yit_Chuen
Regular Visitor

Any method to replace usage of multiple SWITCH function in a measure?

Hello experts,

I would like to seek for help to improve the performance of dashboard. Where I have a complex scenario to achieve and required to apply multiple Switch funtion in a single measure.
The measure looks like this:

Var a = SelectedValue(ColumnA)
Var b = SelectedValue(ColumnB)
Var c = SelectedValue(ColumnC)

Return SWITCH(a,"SampleA",SWITCH(b,"SampleB",SWITCH(TRUE(),......)
However due to multiple Switch funtion used, thus the performance is slow at the moment.

Any idea to re-structure the measure to achieve same result?

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @Lim_Yit_Chuen ,

It is a little difficult to get the solution base on your provided info. Could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

 

In addition, you can refer the following links to try to solve your problem...

DAX Best Practice Guide

Optimizing DAX Video Course

Use Performance Analyzer to examine report element performance (can see and record logs that measure how each of your report elements performs when users interact with them, and which aspects of their performance are most (or least) resource intensive.)

Best Regards

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors