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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show Value as % of Column Total in stacked column chart

Hi,

 

How do I create a measure to calculate the % of Column Total for the Column y-axis in a stacked column chart but I want to exclude the ">18 Mth" from the stacked column chart. The chart data label should show value as per the following table with the country in x-axis:

 

Doris1785_0-1678765034327.png

 

 

2 REPLIES 2
Anonymous
Not applicable

Appreciate your sharing. I managed to figure out a much simpler measure that works which I shared below:

 

Aging INV Value =
VAR CurrMth = MONTH(MAX('Calendar'[Date]))
VAR CurrYr = YEAR(MAX('Calendar'[Date]))
Return
    CALCULATE(SUM('INV Aging'[Inventory Value]), MONTH('Calendar'[Date]) = CurrMth, YEAR('Calendar'[Date]) = CurrYr)
 

Aging % of Total =

VAR ALLAging = Calculate('1_Measures'[Aging INV Value], ALL('Aging Days'))

Return

       DIVIDE('1_Measures'[Aging INV Value], ALLAging)

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

Jihwan_Kim_1-1678767859865.png

 

 

Jihwan_Kim_0-1678767845024.png

 

Ratio: = 
VAR _allcount =
    COUNTROWS ( Data )
VAR _categorycount =
    COUNTROWS (
        FILTER (
            Data,
            Data[Category] >= MIN ( Category[Min] )
                && Data[Category] <= MAX ( Category[Max] )
        )
    )
RETURN
    DIVIDE ( _categorycount, _allcount )

 

Ratio expected result: = 
SUMX(
FILTER(
ADDCOLUMNS( Category, "@ratio", [Ratio:]), Category[Max] <= 18 ), [@ratio] )

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.