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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Dynamically Count Number of Elements in a Quartile

I have a fact table called "Invoices on Hold Monthly Data".

 

I have a measure called "Number Invoices" that is simply a count rows on that table. 

 

I have the below measure which calculates a cumulative percentage of invoices on hold for each supplier in the fact table.

 

Pct total invs supl name =
Var Rksuplnm = if(NOT
(isblank([Number Invoices])),
RANKX(ALLSELECTED
('Invoice On Holds Monthly Data'[Supplier Label]),[Number Invoices],,DESC,Skip))

Var ctotinvs = SUMX(TOPN(Rksuplnm,
ALLSELECTED('Invoice On Holds Monthly Data'[Supplier Label]),
[Number Invoices],DESC),
[Number Invoices])
VAR totselinvs = CALCULATE([Number Invoices], ALLSELECTED('Invoice On Holds Monthly Data'))
VAR cumpctinvoices = DIVIDE(ctotinvs,totselinvs, 0)
RETURN cumpctinvoices

 

I can produce a visual that shows the cumulative % of invoices on hold for any set of suppliers that are currently selected as shown below.

 

jjanecm_1-1640883505856.png

 

I can produce a conditional formatting based on the value of the measure  to show quartiles.

 

I would like to produce a count of suppliers for each quartile based on the selected set of suppliers that could be dropped into a score card.  That is what I am struggling to do.

 

I would also like to be able to see the cumulative percentage calculation by week, but when I add Week End date from my calendar table, I get it sliced in the below fashion.

 

jjanecm_2-1640884332325.png

How would I change my measure so the cumulative percentage would add up to 100 for each week that is filtering the matrix, instead of splitting the total by week?

 

Mark Janecek

PTP Metrics Analyst

Johnson Controls

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous yes one drive or google drive



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous it is very hard to understand what is going on. It will be easier if you can share a sample pbix file using one drive/google drive with the expected result.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

How do I share the pbix via google drive?

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors