Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |