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
ConsatSudbury
Helper I
Helper I

Calculating percentage by group

I need a DAX measure for power bi to calculate the percentage of times each "Journey Name" is "On Time" as opposed to "Late" weighed against itself only.  As an example, I have the left table as my data and I need to be ale to get the result in the right table.

ConsatSudbury_0-1664755402539.png

 

1 ACCEPTED SOLUTION

Hi, @ConsatSudbury 

I have checked the pbix. There is no problem with the formula, you may need to check "show value as no calculation".

veasonfmsft_0-1666165109609.png

Best Regards,
Community Support Team _ Eason

 

View solution in original post

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi, @ConsatSudbury 

@amitchandak 's formula needs to be adjusted, the denominator needs to be placed above the numerator.

% On Time =
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Variance] ),
        FILTER ( 'Table', 'Table'[EarlyLate] = "On Time" )
    ),
    COUNT ( 'Table'[Variance] )
)

 

Best Regards,
Community Support Team _ Eason

Thanks @v-easonf-msft  For some reason, it does not work for my steup. I try to reply and attach my .pbix but I get an error that file .pbix is not supported. Not sure if this link will work.

https://consatdataab-my.sharepoint.com/:u:/g/personal/robert_gauthier_consat_se/EVxWEBBJAU9BkzRFAQUl...

Hi, @ConsatSudbury 

I have checked the pbix. There is no problem with the formula, you may need to check "show value as no calculation".

veasonfmsft_0-1666165109609.png

Best Regards,
Community Support Team _ Eason

 

amitchandak
Super User
Super User

@ConsatSudbury , You have to create measure like

 

divide(Count(Table[Journey Name]), Calculate(Count(Table[Journey Name]), filter(Table, Table[EarlyLate] = "On Time")))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.