Forum Discussion
anthonjhnon1
5 months agoRegular Visitor
DAX Formula Help
Link to files in Onedrive Haven't been here in a long time as I thought my DAX skills were supberb. However this is stomping me to the ground. As when I apply a filter on major event ...
- 5 months ago
Hi anthonjhnon1 , You can update the measuer to use remove filters from the dim table
CIs Test 2 = VAR CIs = CALCULATE(SUM(Fact[TotalCustomersAffected]),REMOVEFILTERS('Major Event'[Major Event])) VAR NonME_CIs = CALCULATE(SUM(Fact[nonME_CI]),REMOVEFILTERS('Major Event'[Major Event])) VAR MajorEvent = SELECTEDVALUE('Major Event'[Major Event]) VAR MENo = NonME_CIs VAR MEYes = CIs - NonME_CIs RETURN SWITCH( MajorEvent , "y", MEYes , "n", NonME_CIs , CIs )
SampleData.pbix
Thanks
anthonjhnon1
5 months agoRegular Visitor
Thanks for the tip......I'm trying to get MajorEvent = 'N' to equal 173.
Natarajan_M
5 months agoSuper User
Hi anthonjhnon1 , You can update the measuer to use remove filters from the dim table
CIs Test 2 =
VAR CIs = CALCULATE(SUM(Fact[TotalCustomersAffected]),REMOVEFILTERS('Major Event'[Major Event]))
VAR NonME_CIs = CALCULATE(SUM(Fact[nonME_CI]),REMOVEFILTERS('Major Event'[Major Event]))
VAR MajorEvent = SELECTEDVALUE('Major Event'[Major Event])
VAR MENo = NonME_CIs
VAR MEYes = CIs - NonME_CIs
RETURN
SWITCH(
MajorEvent
, "y", MEYes
, "n", NonME_CIs
, CIs
)
SampleData.pbix
Thanks