Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
78 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |