Forum Discussion
Need help on filter dax
Some add on information
Table 1
Table 2
Currently when i select the individual country, the sales amount is showing up.
But when i select CTY, the sales amount is showing blank. I'm not sure if there is any dax could help me to sum up the sales amount from all countries? Much appreciate it.
- FreemanZ3 years ago
Super User
hi Hong_HW
Try like:Measure =IF(SELECTEDVALUE(Table1[Country]) = "CTY",SUMX(ALL(Table2),Table2[USD]),SUM(Table2[USD]))- Hong_HW3 years agoFrequent Visitor
Thank you very much, it works 👍.
I've tried the following formula, but it doesn't work. Not sure what is the issue. It will be much appreated if you could advise too?
Test Measure 1 =
VAR SelectedCountry = SELECTEDVALUE('Table 1'[Country rollup])
VAR SelectedHub = SELECTEDVALUE('Table 1'[Hub])RETURN
IF(
SelectedHub = "CTY",
CALCULATE(
SUM('Table 2'[Amount]),'Table 2'[Country] in {"PH","MY","CN","HK"}),
CALCULATE(
SUM('Table 2'[Amount]),
'Table 2'[Country] = SelectedCountry)
)