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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Bashir_Nadaf
Helper I
Helper I

how to calculate percentage from 2 column

HI Community 

i am trying to calculate the percentage of only expired row 

can please help how to manage with DAX  to achieve this 

 

Expiry status and Available quantity both are column

 

Expiry StatusAvailable quantity
Expired11,27,200
Not expired1,79,82,238
TOTAL1,91,09,438
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bashir_Nadaf ,

The easy method is put the field "Available quantity" onto Values options and show values as "Percent of grand total" just as below screenshot.

yingyinr_0-1654765555124.png

Or you can create a measure as below to get it,  you can find the details in the attachment.

Measure = 
VAR _expired =
    CALCULATE (
        SUM ( 'Table'[Available quantity] ),
        'Table'[Expiry Status] = "Expired"
    )
VAR _all =
    CALCULATE ( SUM ( 'Table'[Available quantity] ), ALLSELECTED ( 'Table' ) )
RETURN
    DIVIDE ( _expired, _all, 0 )

yingyinr_1-1654765817563.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Bashir_Nadaf ,

The easy method is put the field "Available quantity" onto Values options and show values as "Percent of grand total" just as below screenshot.

yingyinr_0-1654765555124.png

Or you can create a measure as below to get it,  you can find the details in the attachment.

Measure = 
VAR _expired =
    CALCULATE (
        SUM ( 'Table'[Available quantity] ),
        'Table'[Expiry Status] = "Expired"
    )
VAR _all =
    CALCULATE ( SUM ( 'Table'[Available quantity] ), ALLSELECTED ( 'Table' ) )
RETURN
    DIVIDE ( _expired, _all, 0 )

yingyinr_1-1654765817563.png

Best Regards

Thank you so much @Anonymous 😊😊
This post helped me alot 

rajulshah
Resident Rockstar
Resident Rockstar

Hello @Bashir_Nadaf ,
Can you please provide raw data?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors