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.
Hi, I have a distinctcount calculated column on a summarized table "Summary" which is taking too long to compute (my computer runs out of memory before it can finish). Please can someone help me find a way to make this work more efficiently? Thank you.
Solved! Go to Solution.
Hi @Anonymous
You can use TREATAS as below if it's still too slow, consider moving the calculation to Power Query.
DISTINCTCOUNT_USERS_ =
VAR __filter = { ( Summary[Code], Summary[Date], "Completed" ) }
RETURN
CALCULATE(
DISTINCTCOUNT( Table1[UserID] ),
TREATAS(
__filter,
Table1[Code], Table2[EventDate], Table2[Status]
)
)
@Anonymous ,
Try if this can work better
countx(summarize(calculatetable(Table1,
filter(Table1,Table1[Code]=Summary[Code]),
filter(Table2,Table2[Status]="Completed"),
filter(Table2,Table2[EventDate]=Summary[Date])),Table1[UserID])[UserID])
Hi @Anonymous
You can use TREATAS as below if it's still too slow, consider moving the calculation to Power Query.
DISTINCTCOUNT_USERS_ =
VAR __filter = { ( Summary[Code], Summary[Date], "Completed" ) }
RETURN
CALCULATE(
DISTINCTCOUNT( Table1[UserID] ),
TREATAS(
__filter,
Table1[Code], Table2[EventDate], Table2[Status]
)
)
Hi @amitchandak are you sure the brackets etc. are in the right place? Power BI doesn't like that code
@Anonymous one , was missing
countx(summarize(calculatetable(Table1,
filter(Table1,Table1[Code]=Summary[Code]),
filter(Table2,Table2[Status]="Completed"),
filter(Table2,Table2[EventDate]=Summary[Date])),Table1[UserID]),[UserID])
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |