Forum Discussion
To Help understand DAX MEASURE | RANKX | Filter Context | Row Context
- 3 years ago
Please try
M1 =SUMX(VALUES(FactMemberQualityMeasures[QMID]),VAR CurrentQMID =FactMemberQualityMeasures[QMID]RETURNSUMX (CALCULATETABLE(VALUES ( FactMemberQualityMeasures[MemberID] )),VAR QM2_data =CALCULATETABLE(FactMemberQualityMeasures,FactMemberQualityMeasures[QMID] IN { 10, 11, 12, 13 },ALL ( DimQualityMeasures[QMID]))VAR QM2_Dataset =TOPN ( 1, QM2_data, FactMemberQualityMeasures[RISK_RANK], ASC )VAR maxQMID =MAXX(QM2_Dataset, FactMemberQualityMeasures[QMID])RETURNIF(CurrentQMID = maxQMID,SUMX ( QM2_Dataset, FactMemberQualityMeasures[DENOMINATOR] ))))
Hi tamerj1 , Sorry, I was just over the moon when I saw the Numbers are matching for each month, Multiple months and all months (Data is matching for all Scenarios), but When I drill down to QMID level, the sum of Individual numbers are higher than Total like below
I could not debud betwwen this row_context and filter context. Could you me understand why is this happening?
Try what you get out of this. It should give better idea. Deactivate total before doing that
=
CONCATENATEX (
VALUES ( FactPatient[Member ID] ),
VAR QM2_data =
FILTER (
CALCULATETABLE ( FactPatient ),
FactPatient[QMID] IN { 10, 11, 12, 13 }
)
VAR QM2_Dataset =
TOPN ( 1, QM2_data, FactPatient[Ranked_Risk], ASC )
RETURN
CONCATENATEX ( QM2_Dataset, FactPatient[NUMERATOR], " - " ),
UNICHAR ( 10 )
)
- selvakumarr3 years agoFrequent Visitor
I have got 5411 (as expected) records with 5176 records 1s and rest as zero both as expected.
It is happening the same with SUMX as well. The issue was when QMID is brought into dimension, then the individual or row level calcs are not matching the total.