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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JamieH
Helper I
Helper I

Show percentage against ALL for each legend item in a chart

I am trying to create a chart that has a legend with 5 or 6 different items.  

 

The chart shows the percentage of an event occuring for each legend item, so you can have big swings in percentage.  I would like to show the percentage for each legend based on the total amount (i guess you would describe this as having the denominator being an unfiltered total amount, whilst the numerator is the filtered/legend amount).   Does anyone have any suggestions on how to do this?  

 

Here is the measure I am using to get the %:

 
1At3BalPct =
Var TotLoans = SUM('BackBook'[amounttofinance])
Var Tot1at3 =
        Calculate (
        SUM (  'BackBook'[amounttofinance]),
        Filter ('BackBook', 'BackBook'[Down1at3C] <> 0)
            )
Return
    Divide ( Tot1at3, TotLoans)

 

 

1 ACCEPTED SOLUTION

@JamieH,

 

I added a VALUES filter argument with a placeholder column name (replace with your actual date column name):

 

1At3BalPct =
VAR TotLoans =
    CALCULATE (
        SUM ( 'BackBook'[amounttofinance] ),
        ALL ( 'BackBook' ),
        VALUES ( 'Backbook'[Date Column] )
    )
VAR Tot1at3 =
    CALCULATE ( SUM ( 'BackBook'[amounttofinance] ), 'BackBook'[Down1at3C] <> 0 )
RETURN
    DIVIDE ( Tot1at3, TotLoans )

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
DataInsights
Super User
Super User

@JamieH,

 

Try this measure:

 

1At3BalPct =
VAR TotLoans =
    CALCULATE ( SUM ( 'BackBook'[amounttofinance] ), ALL ( 'BackBook' ) )
VAR Tot1at3 =
    CALCULATE ( SUM ( 'BackBook'[amounttofinance] ), 'BackBook'[Down1at3C] <> 0 )
RETURN
    DIVIDE ( Tot1at3, TotLoans )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for this.

It doesnt quite work as the this measure is being pushed into a chart to show on a monthly basis, but the addition of the ALL ( Backbook ) means that it is dividing the monthly value for 'BackBook'[Down1at3C] <> 0 against the total EVER and not just by each of the months in the chart. 

 

Is there a way of adjusting this so it incorporates that date element?

@JamieH,

 

I added a VALUES filter argument with a placeholder column name (replace with your actual date column name):

 

1At3BalPct =
VAR TotLoans =
    CALCULATE (
        SUM ( 'BackBook'[amounttofinance] ),
        ALL ( 'BackBook' ),
        VALUES ( 'Backbook'[Date Column] )
    )
VAR Tot1at3 =
    CALCULATE ( SUM ( 'BackBook'[amounttofinance] ), 'BackBook'[Down1at3C] <> 0 )
RETURN
    DIVIDE ( Tot1at3, TotLoans )

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you, thats great. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.