Forum Discussion
shei7141
5 years agoHelper III
Dax multiple conditional sum
Hi guys, I have a table which looks like this: Store Phases Estimated cost J&J A 1 J&J B J&J C 2 J&J D 3 TimLee A 5 TimLee B 3 TimLee C TimLee D ...
- 5 years agoYes, a MEASURE does not have the row context of the table. You can try two options:
Option A:
Use SUMX(Table, IF( insert your formula here)
Option B:
Use the SELECTEDVALUE function around any column you want to reference. This will only return a value if there is 1 value for the selected column, so requires a specific table configuration.
I prefer Option A in this case.
AllisonKennedy
5 years agoCommunity Champion
Not sure what the problem is? What formula do you want to use for Measure =1 and measure=2?
What configuration do you want to have in the final table display?
A simple IF or SWITCH should do what you want, unless you have a complex table configuration, then you may need to start looking at ALL or other similar options.
What configuration do you want to have in the final table display?
A simple IF or SWITCH should do what you want, unless you have a complex table configuration, then you may need to start looking at ALL or other similar options.
- shei71415 years agoHelper III
Thank mate
I am having trouble with referencing table's columns in a measure. In excel, I would have said,
if(and(Phase = "B",Estimate Value >0), 1, 2)
It is a simple tab and simple if and condition but I am struggling to define it as a measure.
Ta
Shei
- AllisonKennedy5 years agoCommunity ChampionYes, a MEASURE does not have the row context of the table. You can try two options:
Option A:
Use SUMX(Table, IF( insert your formula here)
Option B:
Use the SELECTEDVALUE function around any column you want to reference. This will only return a value if there is 1 value for the selected column, so requires a specific table configuration.
I prefer Option A in this case.