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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a measure that returns the number of items that make up a given % of sales for a given customer. Visuals using the measure load very slowly...every other visual loads nearly instantly, and this one takes >1 minute. Any tips on ways to clean this up?
NumberOfItems =
VAR TotalSales = CALCULATE( [NetSales], ALL( 'dw dimItem' ) )
VAR ThreesholdPercentage = 0.5
RETURN
COUNTROWS(
FILTER(
CALCULATETABLE(
ADDCOLUMNS(
ADDCOLUMNS(
VALUES( 'dw dimItem'[ItemKey] ),
"TotalSalesOuter", [NetSales]
),
"CumulatedPercentage",
DIVIDE(
SUMX(
FILTER(
ADDCOLUMNS(
VALUES( 'dw dimItem'[ItemKey] ),
"TotalSalesInner", [NetSales]
),
[TotalSalesInner] >= [TotalSalesOuter]
),
[TotalSalesInner]
),
TotalSales
)
),
ALL( 'dw dimItem' )
),
[CumulatedPercentage] <= ThreesholdPercentage
)
)
Solved! Go to Solution.
Hi, @Brotedo
According to your description, When you put this measure in visuals, visuals become slow to load. Right?
Here are a few things you can try to optimize your dax:
(1)Filter the table as early as possible.
(2)Simplify your logic.
(3)Stop using VALUES if you do not have to use them.
You can refer to this document :
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @Brotedo
According to your description, When you put this measure in visuals, visuals become slow to load. Right?
Here are a few things you can try to optimize your dax:
(1)Filter the table as early as possible.
(2)Simplify your logic.
(3)Stop using VALUES if you do not have to use them.
You can refer to this document :
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Here is everything you need to know to write things like this: ABC classification – DAX Patterns
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 |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |