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

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

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
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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.