cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

8 REPLIES 8
Super User IV
Super User IV

@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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

@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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors