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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
DennisSchlein
Helper III
Helper III

New to power bi / Simle dax

Hi 

Ive been trying for hours now to find the right way. But I can't.

I want to calclulate the share of parcels delivered on time.

I have a table, where the count of rows is my total.

Ex.:
ParcelNumber - CompletionDiffDays
12456               -             1
11123               -             0
13246               -             0



Co I want to count rows/ParcelNumber as total. Then all rows <0 = On time, the rest is delayed.

So this example would be 3 total, 1 delayed, 1 on time. So I want a card to display 66,6% on time.

But how to write the calculation?


1 ACCEPTED SOLUTION
DennisSchlein
Helper III
Helper III

I found out:

On time deliveries = (CALCULATE( COUNTROWS( 'Fact' ), FILTER( ALL('Fact'), 'Fact'[CompletionDiff] <= 0 ))/CALCULATE(COUNTROWS('Fact')))
 

View solution in original post

4 REPLIES 4
DennisSchlein
Helper III
Helper III

I found out:

On time deliveries = (CALCULATE( COUNTROWS( 'Fact' ), FILTER( ALL('Fact'), 'Fact'[CompletionDiff] <= 0 ))/CALCULATE(COUNTROWS('Fact')))
 
truptis
Community Champion
Community Champion

Hi @DennisSchlein , 

Your requirement is not very clear, especially the formula. Could you please give a proper example? 

Hi 
I have made this simple sample dataset.


So I want to count destinct tracking number - as total.
In this case, 28. Then all the parcel numbers with a CompletionDiff less or equal to 0 is on time.
So the on time share of the total? (sorry for the picture. I cannot figure how to insert two coloumns from excel and format it correctly. 

DennisSchlein_0-1647331930453.png

 


Kind regards



DennisSchlein
Helper III
Helper III

Was thinking something like this could have worked, but it doen't:

TotalShare = CALCULATE(DISTINCTCOUNT('Fact'[CompletionDiff]), 'Fact'[CompletionDiff] <= 0) / CALCULATE(COUNTROWS('Fact') )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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