Forum Discussion
DAX Syntax for If Statement with Filter
- 8 years ago
Thanks that works.
My assumption is you can't compare multiple columns in an if statement?
Your measure does refer to two columns. Exporter and Product. Have you considered using your measure inside a calculate and using your filter there?
msr_221ImportDutyRate = If (ISFILTERED('Trade Compliance'[Grower Country (Exporter)]) && HASONEVALUE('Trade Compliance'[Grower Country (Exporter)]), CONCATENATEX(VALUES('Trade Compliance'[Item Duty Rate]),[Item Duty Rate],", ",[Item Duty Rate],ASC),"")
msr_221ImportDutyRateWithProductFilter =CALCULATE([msr_221ImportDutyRate], FILTER('TradeCompliance','TradeCompliance'[Product]="Lettuce"))
Thanks that works.
My assumption is you can't compare multiple columns in an if statement?
- kcantor8 years agoCommunity Champion
I think it was more along the lines of having too many "ands" involved without nesting the if statement.