Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello everyone,
after a day of trying stuff on my own i got to admit it: i need help 😄
My problem:
I got a specific measure that slows my report down (takes about 5 minutes to load each time i filter something).
Details:
I got a measure X (some simple COUNTROW and DISTINCTCOUNT - nothing fancy here).
Then i got X_LastYear (CALCULATE(X, SAMEPERIODLASTYEAR(...)) ).
Everything sooth and fast up to this... now comes what starts to make my blood boil:
I want to know the result from X, if X and X_LastYear are both not blank.
I got two version to work and both of them are far to slow use them.
1.
X in both=
VAR __LEFT=
FILTER(
ADDCOLUMNS(
'table';
"FLAG";[X]
);
[FLAG]>0
)
VAR __RIGHT=
FILTER(
ADDCOLUMNS(
'table';
"FLAG";[X_LastYear]
);
[FLAG]>0
)
RETURN
COUNTROWS(
INTERSECT(
__LEFT;
__RIGHT
)
)Works fine... and gives you the time to solve all the worlds problems inbetweeni its calculations 🙂
2.
X in both=
VAR __SUMM=
FILTER(
ADDCOLUMNS(
SUMMARIZE(
'table';
'table'[column]
);
"FLAG";[X]+[X_LastYear]
);
[FLAG]=2
)
RETURN
CALCULATE(
[X];
__SUMM
)And again: Worlds problems are solved....
Here i got two questions:
Thanks in advance
Best, Chris
Solved! Go to Solution.
Hi @crisc
It seems the second measure is perfect.I would suggest you have a look at this article about Best Practices Using SUMMARIZE and ADDCOLUMNS.
Regards,
Cherie
Hi @crisc
It seems the second measure is perfect.I would suggest you have a look at this article about Best Practices Using SUMMARIZE and ADDCOLUMNS.
Regards,
Cherie
Hi @v-cherch-msft,
It seems the second measure is perfect.
I am glad to hear that, even it won't solve my problem 😉
Thanks for the article you mentioned, it helped to understand what these functions really are doing.
For now i will cross this measure from my to-do list... if i can get it to work sometime in a proper way, i will give you an update here.
Best,
Chris
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |