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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
angsoka
Frequent Visitor

Percentage based on maximum value of a row

Dear all,

I want to create a measure on powerpivot which calculate the percentage over the maximum value and specific country (for example Thailand). Below is the part of the data.

 

YearCountryExport
2021Indonesia60
2021Vietnam70
2021Singapore80
2021Thailand100
2022Indonesia200
2022Vietnam120
2022Singapore150
2022Thailand100


I want to create two measurements %Max and %Thailand

 

YearCountryExport%Max%Thailand
2021Indonesia6060%60%
2021Vietnam7070%70%
2021Singapore8080%80%
2021Thailand100100%100%
2022Indonesia200100%200%
2022Vietnam12060%120%
2022Singapore15075%150%
2022Thailand10050%100%


Any help is appreciated!

angsoka

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @angsoka 

try to plot a table visual with necessary columns and two measures like:

%Max = 
DIVIDE(
    MAX(data[Export]),
    MAXX(
        FILTER(
            ALL(data),
            data[Year]=MAX(data[Year])
        ),
    data[Export]
    )
)
%Thailand = 
DIVIDE(
    MAX(data[Export]),
    MAXX(
        FILTER(
            ALL(data),
            data[Year]=MAX(data[Year])
             &&data[Country]="Thailand"
        ),
        data[Export]
    )
)

it worked like:

FreemanZ_0-1683165784786.png

View solution in original post

2 REPLIES 2
angsoka
Frequent Visitor

Dear @FreemanZ 

Thank you so much. It works like a charm.
However, when I use that same measure for this table (I add one column called "Goods"). It doesn't work. Is there any filter that I should add?

YearCountryGoodsExport
2021IndonesiaA60
2021VietnamA70
2021SingaporeA80
2021ThailandA100
2022IndonesiaA200
2022VietnamA120
2022SingaporeA150
2022ThailandA100
2021IndonesiaB70
2021VietnamB60
2021SingaporeB90
2021ThailandB100
2022IndonesiaB200
2022VietnamB130
2022SingaporeB140
2022ThailandB80




FreemanZ
Super User
Super User

hi @angsoka 

try to plot a table visual with necessary columns and two measures like:

%Max = 
DIVIDE(
    MAX(data[Export]),
    MAXX(
        FILTER(
            ALL(data),
            data[Year]=MAX(data[Year])
        ),
    data[Export]
    )
)
%Thailand = 
DIVIDE(
    MAX(data[Export]),
    MAXX(
        FILTER(
            ALL(data),
            data[Year]=MAX(data[Year])
             &&data[Country]="Thailand"
        ),
        data[Export]
    )
)

it worked like:

FreemanZ_0-1683165784786.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.