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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors