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
Jeroen_B
New Member

Dynamic measure selection: SWITCH TRUE() method too slow for more than 10+ measures

Hi,

 

Is there an alternative to using disconnected slicers with a switch (true) statement that processes more than 10+ measures?

 

I have implemented the method prescribed in many posts (see example link below) but it runs up to 60 seconds whereas the single measures only take 2 to 5 seconds each.

https://community.powerbi.com/t5/Desktop/Dynamic-Measure-Problem-By-Switch-Statement/m-p/489167

 

Thank you in advance.

 

My statement:

All Measures =
var varSelected = SELECTEDVALUE('Measures'[Measure])
Return
SWITCH(varSelected,
"3P Sales Volume Consumer Units",[3P Sales Volume Consumer Units],
"Acq Deflated TO",[Acq Deflated TO],
"Acq TO",[Acq TO],
"Base Turnover",[Base Turnover],
"BBT excl CPP",[BBT excl CPP],
"Brand & Marketing Investment",[Brand & Marketing Investment],
"Business Building",[Business Building],
"Business Building Cons. Price Promotion",[Business Building Cons. Price Promotion],
"Business Building Pack",[Business Building Pack],
"Business Building Place",[Business Building Place],
"Business Building Product",[Business Building Product],
"Business Building Promotion",[Business Building Promotion],
"COGS Total Supply Chain Costs",[COGS Total Supply Chain Costs],
"Coupons",[Coupons],
"Deflated Turnover",[Deflated Turnover],
"Disp TO",[Disp TO],
"Efficient Operations",[Efficient Operations],
"EO Logistic Conditions",[EO Logistic Conditions],
"EO Payment Conditions",[EO Payment Conditions],
"Gross Profit",[Gross Profit],
"Gross Sales Value (GSV)",[Gross Sales Value (GSV)],
"Net In Pocket (**bleep**)",[Net In Pocket (**bleep**)],
"Net Invoice Value (NIV)",[Net Invoice Value (NIV)],
"Net Sales Value (NSV)",[Net Sales Value (NSV)],
"Overheads",[Overheads],
"Profit Before Overheads",[Profit Before Overheads],
"Total Off-Invoice",[Total Off-Invoice],
"Total On-Invoice",[Total On-Invoice],
"Trade Terms",[Trade Terms],
"Trade Terms Customer Specific",[Trade Terms Customer Specific],
"Trade Terms General Terms",[Trade Terms General Terms],
"Trade Terms Other",[Trade Terms Other],
"Trade Terms Results Oriented",[Trade Terms Results Oriented],
"Turnover",[Turnover],
"Underlying Operating Profit",[Underlying Operating Profit],
"BBT excl CPP %GSV",[BBT excl CPP %GSV],
"Business Building %GSV",[Business Building %GSV],
"Business Building Cons. Price Promotion %GSV",[Business Building Cons. Price Promotion %GSV],
"Business Building Pack %GSV",[Business Building Pack %GSV],
"Business Building Place %GSV",[Business Building Place %GSV],
"Business Building Product %GSV",[Business Building Product %GSV],
"Business Building Promotion %GSV",[Business Building Promotion %GSV],
"Coupons %GSV",[Coupons %GSV],
"Efficient Operations %GSV",[Efficient Operations %GSV],
"EO Logistic Conditions %GSV",[EO Logistic Conditions %GSV],
"EO Payment Conditions %GSV",[EO Payment Conditions %GSV],
"Net In Pocket (**bleep**) %GSV",[Net In Pocket (**bleep**) %GSV],
"Net Invoice Value (NIV) %GSV",[Net Invoice Value (NIV) %GSV],
"Net Sales Value (NSV) %GSV",[Net Sales Value (NSV) %GSV],
"Total Off-Invoice %GSV",[Total Off-Invoice %GSV],
"Total On-Invoice %GSV",[Total On-Invoice %GSV],
"Trade Terms %GSV",[Trade Terms %GSV],
"Trade Terms Customer Specific %GSV",[Trade Terms Customer Specific %GSV],
"Trade Terms General Terms %GSV",[Trade Terms General Terms %GSV],
"Trade Terms Other %GSV",[Trade Terms Other %GSV],
"Trade Terms Results Oriented %GSV",[Trade Terms Results Oriented %GSV],
"B&MI%",[B&MI%],
"COGS%",[COGS%],
"GM%",[GM%],
"OH%",[OH%],
"PBO%",[PBO%],
"UOM%",[UOM%],
"UPG%",[UPG%],
"USG%",[USG%],
"UVG%",[UVG%],
"COGS per Consumer Unit",[COGS per Consumer Unit],
"Gross Profit per Consumer Unit",[Gross Profit per Consumer Unit],
"GSV per Consumer Unit",[GSV per Consumer Unit],
"Trade Terms per Consumer Unit",[Trade Terms per Consumer Unit],
"Turnover per Consumer Unit",[Turnover per Consumer Unit],
Blank())

 

 

 

 

 

0 REPLIES 0

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.

Top Solution Authors