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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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