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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pborah
Continued Contributor
Continued Contributor

Running totals for ranked categories without using date?

Hi all,

 

I have 8 categories "Sales over 5000", "Sales over 10,000", ..... "Sales over 40,000". Clearly these categories are ranked but there is nothing in the dataset to tell PowerBI so. That is the first problem. Next I want to create a cumulative frequency or a running total table for this information sorted by the ranked categories in ascending order. I have read most of the cumulative freq/running total articles but it seems they all have something to do with date whereas I have no need for using date in my problem to the best of my understanding. Can anyone please explain how to go about it in such a scenario? Thank you.

1 ACCEPTED SOLUTION
pborah
Continued Contributor
Continued Contributor

After a lot of searching, here's what I went with -

 

First I created a measure called -

 

Transaction Count = CALCULATE(COUNT(Query1[Transaction Number]))

 

Next I created another measure -

TN Cumulative Count = CALCULATE([Transaction Count],FILTER(ALL(Query1[Sales Class]),Query1[Sales Class]>=MAX(Query1[Sales Class])))

 Now I select a table visual, and drop Sales Class, Count of Sales, and TN Cumulative Count in Values and voila!

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

First you need to decided if your buckets can be defined as a calculated column (not impacted by user filter choices) or as a measure (impacted by user filter choices)

 

And second, yes, you DO need a calendar table. How else are you planning to do the cumulative calculation?

pborah
Continued Contributor
Continued Contributor

Thank you @lbendlin  for your response. My buckets are in fact calculated columns. I'm looking to create a basic cumulative frequency (count or percentage does not matter) table that they teach you in elementary stats class such as this one -

 
 
 
ClassFrequencyCumulative Frequency
0-522
5-1068
10-151321
15-201738
20-251149
25-30453
30-35255
 55 

 

Can you please explain why I need a date column to have this table?? Thanks.

pborah
Continued Contributor
Continued Contributor

After a lot of searching, here's what I went with -

 

First I created a measure called -

 

Transaction Count = CALCULATE(COUNT(Query1[Transaction Number]))

 

Next I created another measure -

TN Cumulative Count = CALCULATE([Transaction Count],FILTER(ALL(Query1[Sales Class]),Query1[Sales Class]>=MAX(Query1[Sales Class])))

 Now I select a table visual, and drop Sales Class, Count of Sales, and TN Cumulative Count in Values and voila!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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