Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I am trying to show the running total for % of total. In the image below the red line is the actual % of total. But I want to sum these together, like the yellow line but the values are incorrect.
This is my current measure however I am not sure where it is wrong. I have tried other solutions that have been provided but was unable to get them to work.
PL RunningTotal =
MAXX (
vwPBIPourLineData,
SUMX (
FILTER (
SUMMARIZE (
CALCULATETABLE (
vwPBIPourLineData,
ALLEXCEPT (
vwPBIPourLineData,
vwPBIPourLineData[WeekNumber]
),
ALLSELECTED ( vwPBIPourLineData[WeekNumber] )
),
vwPBIPourLineData[PartNumber],
"AbsDiff", SUM ( vwPBIPourLineData[AbsoluteDiff] )
),
[AbsDiff]
>= SUMX (
FILTER (
CALCULATETABLE (
vwPBIPourLineData,
ALLEXCEPT (
vwPBIPourLineData,
vwPBIPourLineData[WeekNumber]
),
ALLSELECTED ( vwPBIPourLineData[WeekNumber] )
),
vwPBIPourLineData[PartNumber]
= EARLIER ( vwPBIPourLineData[PartNumber], 2 )
),
vwPBIPourLineData[AbsoluteDiff]
)
),
[AbsDiff]
)
)
// Say that you want to have a "RT"
// across products and you want to
// sort them by a measure. Call the
// measure [Base Measure].
// Instead of products, you could
// write a very similar measure
// that would give you a RT across
// product categories, for instance.
[Base Measure - Product RT] =
// Products should be on your x-axis
// and sorted according to [Base Measure]
// descending.
var __totalVisible =
CALCULATE(
[Base Measure],
ALLSELECTED( Products )
)
var __singleProductVisible =
HASONEVALUE( Products[ProductId] )
var __currentProductValue = [Base Measure]
// Get the value of the base measure
// for all products before and including
// this one sorted by base measure
// descending.
var __totalForProductsUpToThisOne =
SUMX(
ALLSELECTED( Products ),
var __iteratedProdValue = [Base Measure]
var __shouldAdd =
__iteratedProdValue >= __currentProductValue
return
__iteratedProdValue * __shouldAdd
)
var __runningTotalPercentage =
DIVIDE(
__totalForProductsUptoThisOne,
__totalVisible
)
return
if( __singleProductVisible, __runningTotalPercentage )
You have to think about how to deal with ties, that is, when 2 different products have the same [Base Measure].
Best
D
Thanks, I tried this method but still no luck. Any other recommendations are welcome.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |