Forum Discussion
ravdha85
3 years agoFrequent Visitor
Need Help with DAX measure
Hi Experts, I have a use case in a self service report Model where end users can select one column at a time from two or more different tables in to a table visual, based on that my measure's row an...
ravdha85
3 years agoFrequent Visitor
Hi Anonymous
I am not able to use the Switch function, for eg. I have 3 different meaures like below which I would like to have it in a switch or if condition
Measure1=ISFILTERED('Table1'),SUM('Sales'[Amount]),
SUMX(VALUES('Table1'),CALCULATE(SUM('Sales'[Amount])
Measure2=ISFILTERED('Table2'),SUM('Sales'[Amount]),
SUMX(VALUES('Table2'),CALCULATE(SUM('Sales'[Amount])
Measure3=ISFILTERED('Table3'),SUM('Sales'[Amount]),
SUMX(VALUES('Table3'),CALCULATE(SUM('Sales'[Amount])
- Anonymous3 years agoNot applicable
Hi ravdha85 ,
Try it.
CombinedMeasure = IF ( ISFILTERED ( 'Table1' ), SUMX ( VALUES ( 'Table1' ), CALCULATE ( SUM ( 'Sales'[Amount] ) ) ), IF ( ISFILTERED ( 'Table2' ), SUMX ( VALUES ( 'Table2' ), CALCULATE ( SUM ( 'Sales'[Amount] ) ) ), IF ( ISFILTERED ( 'Table3' ), SUMX ( VALUES ( 'Table3' ), CALCULATE ( SUM ( 'Sales'[Amount] ) ) ), SUM ( 'Sales'[Amount] ) -- Default value if none of the conditions are met ) ) )Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.