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
Syndicate_Admin
Administrator
Administrator

Calculates percentages based on the maximum value of the sum of a row

Good day, I write this question again but with fictitious values as requested

RomanG123_0-1672320343859.png

What I need is to create a measure to calculate the % of each vehicle in relation to the maximum value of that column.

In other words, the Chevrolet Onix Hatch would correspond to 100%, the EcoSport would correspond (958.43 / 51268.52) and thus calculate the percentages for each vehicle. In other words, let it look something like this:

RomanG123_1-1672321194096.png

Best regards

2 ACCEPTED SOLUTIONS
Barthel
Solution Sage
Solution Sage

Hey @Syndicate_Admin
Give this a try:

Measure = 
VAR _max =
    CALCULATE ( 
        MAX ( 'Table'[Suma Precio] ),
        REMOVEFILTERS ( 'Table'[Vehiculo] )
    )
VAR _result =
    DIVIDE ( SELECTEDVALUE ( 'Table'[Suma Precio] ), _max )
RETURN
    _result

You calculate the maximum by removing the filter context from vehicle. You then use this maximum to calculate the ratio.

View solution in original post

VigneshSub
New Member

Hi ,
Please use following measure 
% Of Max =
var _max_price = CALCULATE(MAX('Table'[Price]),ALL('Table'[Vehicle]))
return
DIVIDE(SUM('Table'[Price]),_max_price)
VigneshSub_0-1672322703809.png

 

View solution in original post

2 REPLIES 2
VigneshSub
New Member

Hi ,
Please use following measure 
% Of Max =
var _max_price = CALCULATE(MAX('Table'[Price]),ALL('Table'[Vehicle]))
return
DIVIDE(SUM('Table'[Price]),_max_price)
VigneshSub_0-1672322703809.png

 

Barthel
Solution Sage
Solution Sage

Hey @Syndicate_Admin
Give this a try:

Measure = 
VAR _max =
    CALCULATE ( 
        MAX ( 'Table'[Suma Precio] ),
        REMOVEFILTERS ( 'Table'[Vehiculo] )
    )
VAR _result =
    DIVIDE ( SELECTEDVALUE ( 'Table'[Suma Precio] ), _max )
RETURN
    _result

You calculate the maximum by removing the filter context from vehicle. You then use this maximum to calculate the ratio.

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.