Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Solved! Go to Solution.
@Rngomoa Hi!
The issue with the second part of your DAX formula is that the COUNTX function is trying to count the distinct patient IDs in the result of the GROUPBY function, but the GROUPBY function is not returning a table with distinct patient IDs because the MAXX function is being used as an aggregator.
tx_curr =
VAR curdate = MAX(CalenderDate[dates])
RETURN
COUNTX(
FILTER(
ADDCOLUMNS(
SUMMARIZE(
Greencard,
Greencard[patient_id],
Greencard[mflcode],
"tx_curr2", CALCULATE(COUNT(Greencard[patient_id]), Greencard[visit_date] <= curdate && Greencard[visit_date] <= Greencard[ExitDate1])
),
"tx_curr3", IF([tx_curr2] > 0, 1, 0)
),
[tx_curr3] > 0
),
DISTINCT(Greencard[patient_id])
)
BBF
@Rngomoa Hi!
The issue with the second part of your DAX formula is that the COUNTX function is trying to count the distinct patient IDs in the result of the GROUPBY function, but the GROUPBY function is not returning a table with distinct patient IDs because the MAXX function is being used as an aggregator.
tx_curr =
VAR curdate = MAX(CalenderDate[dates])
RETURN
COUNTX(
FILTER(
ADDCOLUMNS(
SUMMARIZE(
Greencard,
Greencard[patient_id],
Greencard[mflcode],
"tx_curr2", CALCULATE(COUNT(Greencard[patient_id]), Greencard[visit_date] <= curdate && Greencard[visit_date] <= Greencard[ExitDate1])
),
"tx_curr3", IF([tx_curr2] > 0, 1, 0)
),
[tx_curr3] > 0
),
DISTINCT(Greencard[patient_id])
)
BBF
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |