The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 Status | Available quantity |
Expired | 11,27,200 |
Not expired | 1,79,82,238 |
TOTAL | 1,91,09,438 |
Solved! Go to Solution.
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.
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 )
Best Regards
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.
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 )
Best Regards
Thank you so much @Anonymous 😊😊
This post helped me alot