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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |