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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate Filled Rate in a calculate column

Hi all,

 

Though this question is related my previous post, im creating a new post as the idea im trying to achieve is different. Below is the data that i have in my model in powerbi.

 

I need to calculate Filled Rate that is "count of orderid with status filled / total orders.  I need this filled rate as a slicer so that my other visuals gets filtered based on this fill rate. So, i need this filled rate in column rather than a measure.

 

Kindly help me how can i achieve this.

 

sourceOrderIDorderstatus
Amrutha1Cancelled
Amrutha2Filled
Frank3Closed
Frank4Halted
Frank5Submitted
LS6 
LS7Cancelled
LS8Closed
LS9Deleted
LS10Filled
LS11Open
LS12Pending
LS13Scheduled
LL14Cancelled
LL15Closed
LL16Filled
LL17Open
LL18Pending Fill
SW19Filled
4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , not very clear

 

column =divide(countx(filter(Table, [source] =earlier([source]) && table[orderstatus]= "Filled"),[OrderID]),countx(filter(Table, [source] =earlier([source])),[OrderID]))

 

measure =

divide(calculate(count(Table[OrderID]), table[orderstatus]= "Filled"),count(Table[OrderID]))

 

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
Greg_Deckler
Community Champion
Community Champion

@Anonymous - I believe you want one of these. PBIX is attached.

 

Column 1 = 
    VAR __All = COUNTROWS(FILTER('Table (26)',[source]=EARLIER([source])))
    VAR __Count = COUNTROWS(FILTER('Table (26)',[source]=EARLIER([source]) && [orderstatus]="Filled"))
RETURN
    IF(ISBLANK(__Count),0,__Count/__All)


Column = 
    VAR __All = COUNTROWS('Table (26)')
    VAR __Count = COUNTROWS(FILTER('Table (26)',[source]=EARLIER([source]) && [orderstatus]="Filled"))
RETURN
    IF(ISBLANK(__Count),0,__Count/__All)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  

 

thanks Greg,  This works funtastic. However, its not working in my actual data.  

 

LP280388_0-1599743231474.png

 

For example, Amrutha total count of orders is 64162 and filled is 18203. So the fill rate should be 18203/64162 = 28.37%.

But i m getting, 55.44%

 

Am i missing anything?

 

below is how i modified your formula.
column111 = divide(countx(filter(Query1, Query1[source_system] =earlier(Query1[source_system]) && Query1[orderstatus]= "Filled"),[order_id]),countx(filter(Query1, Query1[source_system]=earlier(Query1[source_system])),[order_id]))

 

@Anonymous Can you share PBIX?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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