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
LaurieK
Frequent Visitor

Cumulative bar chart for categorical varibale

Hi there.

 

I'm trying to generate a cumulative bar chart on a categorical time based variable. So as can be seen below I have produced the percentages for each timeframe category, but would like to have <28 days as 87%, <60 days as 87+10 = 97%, and <90 as 100%.

LaurieK_0-1600826341134.png

Is there a simple way to do this with the chart options or do I need to create a new variable. If the latter, could someone steer me in the right direction for the dax code? (I am a dax newbie)

 

Thanks in adavance

1 ACCEPTED SOLUTION

@LaurieK ,

Please find the solution file attached after the signature. Leave my last update.

 

I have created one measure where you can you the option you shown in the last update

 

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@LaurieK , Not enough information.

You have to try like

 

 

Cumm = CALCULATE([Measure],filter(allselected(Table),table[bucket] <=table(Sales[bucket])))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Hi again @amitchandak 

 

Sorry, I am unsure how to add a file here. I tried a drag and drop of .pbix file and it didn't work.

I've had to resort to pasting screengrabs of some dummy data, and the subsequent Power BI visual. Hope that makes sense.

 

LaurieK_0-1600831330715.png

 

LaurieK_1-1600831365670.png

 

So I need the above figures to read cumulative, ie 52.17%, 82.6%, 100%

 

Thanks

 

@LaurieK , If days to close is a column , try

 

Cumm = CALCULATE([Measure],filter(allselected(Table),table[days to close] <=max(Table[days to close])))

 

The measure is your % column

@LaurieK ,

Please find the solution file attached after the signature. Leave my last update.

 

I have created one measure where you can you the option you shown in the last update

 

@amitchandak  thank you so much for this. That is perfect!

@amitchandak  Thanks for that..  I didn't actually create a percentage measure, rather just used the visual to calculate that

LaurieK_1-1600833418823.png

I'll try to add as a measure and see how that goes. 

 

 

 

@LaurieK , You upload to onedrive and dropbox and share.

or copy paste table from Power BI

@amitchandak , here you go.. Learning as I go 🙂 

 

RecordDays to closeDays to close cat

125Less than 28
216Less than 28
32829 to 59
45229 to 59
52Less than 28
615Less than 28
713Less than 28
87Less than 28
92929 to 59
106Less than 28
1112Less than 28
1227Less than 28
137Less than 28
145029 to 59
155529 to 59
162Less than 28
175529 to 59
185629 to 59
198960 to 89
207160 to 89
218460 to 89
227Less than 28
236660 to 89

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.

Top Solution Authors