Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

% of Parent Row Total Measure

Hi,

I need help please with this measure as its not returning correct % of parent row total rather its returning 100% for ALL values instead of sum of each value to equal 100%

%JobToAccepInterval by Row Total = DIVIDE (
    SUM('FreightForward'[JOBCOUNT]),
    CALCULATE ( SUM('FreightForward'[JOBCOUNT]), ALLSELECTED(FreightForward[JobToAccep Interval])))
1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Try this,

%JobToAccepInterval by Row Total = 
VAR Month = SELECTEDVALUE('Calendar'[MonthNum])
Return
DIVIDE(SUM(FreightForward[JOBCOUNT]) , CALCULATE(SUM(FreightForward[JOBCOUNT]) , ALLSELECTED(FreightForward) , 'Calendar'[MonthNum] = Month) , BLANK())


/ J 


Connect on LinkedIn

View solution in original post

16 REPLIES 16
vanessafvg
Super User
Super User

can you share your results?

also what have you selected on your slicers, please give some examples of whats going wrong and whtat you are expecting.




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , try

%JobToAccepInterval by Row Total = DIVIDE (
SUM('FreightForward'[JOBCOUNT]),
CALCULATE ( SUM('FreightForward'[JOBCOUNT]), removefilters(FreightForward[JobToAccep Interval])))

or


%JobToAccepInterval by Row Total = DIVIDE (
SUM('FreightForward'[JOBCOUNT]),
CALCULATE ( SUM('FreightForward'[JOBCOUNT]), ALLSELECTED(FreightForward)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak@vanessafvg 

The first measure didn't work but the 2nd measure is close but not quite right i.e. as per screenshot below, the sum of each % should equal 100% for each month

%JobToAccepInterval by Row Total = DIVIDE (
    SUM('FreightForward'[JOBCOUNT]),
    CALCULATE ( SUM('FreightForward'[JOBCOUNT]), ALLSELECTED(FreightForward)))

Annotation 2020-08-31 195551.png

@Anonymous 

Try this measure: Replace [HOURS CATEGORY] with the name of the legend category you have which shows hrs 0-2 and so on.

%JobToAccepInterval by Row Total = 
DIVIDE (
    SUM('FreightForward'[JOBCOUNT]),
    CALCULATE ( SUM('FreightForward'[JOBCOUNT]), 
     ALLSELECTED([HOURS CATEGORY]))
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi @Fowmy, unfortunately that didn't either work either as per screenshot.

%JobToAccepInterval by Row Total = 
DIVIDE (
    SUM('FreightForward'[JOBCOUNT]),
    CALCULATE ( SUM('FreightForward'[JOBCOUNT]), 
     ALLSELECTED(FreightForward[JobToAccep Interval]))
)

Annotation 2020-08-31 195551.png

@Anonymous 

You may share your PBIX file with sample data to check if the model is set up correctly.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

tex628
Community Champion
Community Champion

Try this,

%JobToAccepInterval by Row Total = 
VAR Month = SELECTEDVALUE('Calendar'[MonthNum])
Return
DIVIDE(SUM(FreightForward[JOBCOUNT]) , CALCULATE(SUM(FreightForward[JOBCOUNT]) , ALLSELECTED(FreightForward) , 'Calendar'[MonthNum] = Month) , BLANK())


/ J 


Connect on LinkedIn

@tex628

Can you help me understand why removing filters did not work?

ALLSELECTED(FreightForward[JobToAccep Interval])

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube Linkedin
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

tex628
Community Champion
Community Champion

The calendar table filters FreightForward through the visual legend. The Legend is considered a context filter and is therefore removed by the ALLSELECTED() statement. I'm going to be perfectly honest and say that I'm not exactly sure of the behaviour of ALLSELECTED, it's incredibly complicated.

In my mind the legend of the calendar table should be seperate and unaffected by the ALLSELECTED(), but instead the filter is actually removed. 

If you want to try and grasp just how messed up that syntax is I would advice you to read this: 
https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/ 

Br,
J


Connect on LinkedIn

@tex628 

Thanks a lot!

Lemme start my experiments 🙂

Thanks again
Fowmy

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@tex628that worked perfectly, thank you. Much appreciated:)

tex628
Community Champion
Community Champion

Your allselected statement is removing the filter on month since your month column is in the same table (or doublesided crossfilter) as the freightforward column. 

If the column is in the same table you should create a calendar dimension table. 
If you have a doublesided relationship you should change the crossfilter, either in the relationshipmodel or in the calculation using CROSSFILTER()

Br,
J


Connect on LinkedIn
Anonymous
Not applicable

Hi @tex628, the date column is in a separate calendar table.

tex628
Community Champion
Community Champion

The crossfilter doublesided or one way? 


Connect on LinkedIn
Anonymous
Not applicable

one way

Annotation 2020-08-31 195551.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.