cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sukram1
Frequent Visitor

Break down calculated share to date

Hi!

I have been using the basics of Power BI since a few months but I am relatively new to DAX. I have contract data and would like to calculate a cancellation rate for these.

 

These are an example how the data looks like:

sukram1_0-1668664953557.png


This is what I have created so far. I calclulated the Total sum first:

 

Total = SUM('Tabelle1'[Count])

 

Then I calculated the share and after that the percentage share:

 

Share = CALCULATE([Total]; All('Tabelle1'[Cancelled]))
%Share = DIVIDE([Total]; [Share]; 0)

 

 

My table in Power BI looks like this and that is working:

sukram1_1-1668665406891.png

But when I want to see the cancellation rate for the particular date, it does not work. 

sukram1_2-1668665589759.png

I then had the idea to use ALLSELECT for this instead of ALL. Unfortunately, this didn't help either and I think I'm a bit lost and don't know what I'm doing.

 

I think it is a very simple question but I need some help 🙂

 

Big thanks in advance!

Markus

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sukram1 , Try like

 

Divide(CALCULATE([Total]; Filter( 'Tabelle1','Tabelle1'[Cancelled] ="Yes") ),[Total])

 

or

 

Divide(CALCULATE([Total]; Filter( 'Tabelle1','Tabelle1'[Cancelled] ="Yes") ),calculate([Total],allselected()) )



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

View solution in original post

3 REPLIES 3
Rushki
Regular Visitor

Hey @sukram1 
Please find below the base data, the measure and the two outputs (by Cancellation Status and by Date)
Please like If you find this helpful. The measure is quite simple. It will work automatically with the Yes/No status and Dates

Rushki_0-1668673604669.png

 

amitchandak
Super User
Super User

@sukram1 , Try like

 

Divide(CALCULATE([Total]; Filter( 'Tabelle1','Tabelle1'[Cancelled] ="Yes") ),[Total])

 

or

 

Divide(CALCULATE([Total]; Filter( 'Tabelle1','Tabelle1'[Cancelled] ="Yes") ),calculate([Total],allselected()) )



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

@amitchandak Thank you very much! This is exactly what I am looking for! It works perfect!!

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors