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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
I try this Measure
Solved! Go to Solution.
@_Loic Let's try a different approach:
_Cumul_III =
VAR CurrentProduct = SELECTEDVALUE(Produits[PRO_CODE])
VAR Mon_Numero = RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense)
VAR My_Sum =
CALCULATE(
SUM([_Marges_2]),
FILTER(
ALL(Produits[PRO_CODE]),
RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense) <= Mon_Numero &&
SELECTEDVALUE(Produits[PRO_CODE]) = CurrentProduct
)
)
RETURN My_Sum
BBF
Hello BBF,
Really great !
it works perfectly !!
Thanks .
@_Loic Hi!
Try with:
_Cumul_III =
VAR Mon_Numero = RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense)
VAR SelectedProducts = TOPN(Mon_Numero, VALUES(Produits[PRO_CODE]), [_Marges_2], DESC)
VAR My_Sum = CALCULATE(SUM([_Marges_2]), FILTER(ALL(Produits[PRO_CODE]), RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense) <= Mon_Numero))
RETURN My_Sum
BBF
Thanks a lot,
Your code is interesting, better than me.
But i have the same result ...
@_Loic Let's try a different approach:
_Cumul_III =
VAR CurrentProduct = SELECTEDVALUE(Produits[PRO_CODE])
VAR Mon_Numero = RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense)
VAR My_Sum =
CALCULATE(
SUM([_Marges_2]),
FILTER(
ALL(Produits[PRO_CODE]),
RANKX(ALLSELECTED(Produits[PRO_CODE]), [_Marges_2], , DESC, Dense) <= Mon_Numero &&
SELECTEDVALUE(Produits[PRO_CODE]) = CurrentProduct
)
)
RETURN My_Sum
BBF
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 10 | |
| 6 | |
| 6 |