Forum Discussion
Calculating values for Cross Matrix table in Power BI DAX
- Anonymous3 years ago
Hi Hell-1931 ,
Please try this measure.
Measure = VAR _ADDCOLUMN = ADDCOLUMNS('Table',"Flag",IF([Diagnosis_Desc] = MAX(MH[Diagnosis_Desc]) || [Diagnosis_Desc] = MAX(SA[Diagnosis_Desc]),1,0)) VAR _SUMMAIZE = SUMMARIZE(_ADDCOLUMN,[ClientID],"Sum",SUMX(FILTER(_ADDCOLUMN,'Table'[ClientID] = EARLIER('Table'[ClientID])),[Flag])) RETURN COUNTAX(FILTER(_SUMMAIZE,[Sum]=2),[ClientID]) + 0Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Hell-1931 ,
Please try this measure.
Measure =
VAR _ADDCOLUMN = ADDCOLUMNS('Table',"Flag",IF([Diagnosis_Desc] = MAX(MH[Diagnosis_Desc]) || [Diagnosis_Desc] = MAX(SA[Diagnosis_Desc]),1,0))
VAR _SUMMAIZE = SUMMARIZE(_ADDCOLUMN,[ClientID],"Sum",SUMX(FILTER(_ADDCOLUMN,'Table'[ClientID] = EARLIER('Table'[ClientID])),[Flag]))
RETURN
COUNTAX(FILTER(_SUMMAIZE,[Sum]=2),[ClientID]) + 0
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rico Zhou,
Sorry, just to let you know -
Your measure worked perfectly.
But what if I'd needed 2 more fields in my original dataset -
[ProgramID], [Date]?
In that case the measure works not correctly.
How should I modify it, so it would work with [ProgramID], [Date] in a dataset?
Here is the link to my post
Cross Matrix table in Power BI DAX - need to count... - Microsoft Power BI Community