Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hiya,
Looking for some help with cumulative percentages.
I have a mapping table to help with custom sorting my dates (E.g table 1).
My actual data sits in a separate table (example snippet below - table 2).
I am trying to do a line graph of the cumulative % based on the 'time to delivery' column to figure out how many items were delivered within a set timeframe. I can't use the date feature as the categories are custom.
E.g based on the data below:
20% were delivered within a week
40% were delivered within a month
100% were delivered within a year
Please can you help provide a measure that will do this?
Thank you!
Table 1:
Date type | Order |
Week | 1 |
Month | 2 |
6 Month | 3 |
Year | 4 |
Table 2:
Date delivered | Time to delivery (days) | Speed of completion |
21/03/22 | 7 | Week |
27/04/23 | 31 | Month |
27/04/23 | 278 | Year |
13/09/22 | 75 | Year |
13/03/23 | 21 | Month |
Solved! Go to Solution.
Hi , @MishiAb
According to your description, you want to get the cumulative % based on the 'time to delivery' column to figure out how many items were delivered within a set timeframe.
This is my test data and my undersyand for your need:
We can create a measure like this :
Measure = DIVIDE( SWITCH( MAX('Table1'[Date type]) ,
"Week" , CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=7) ,
"Month",CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=31) ,
"6 Month",CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=186),
"Year" ,CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=366)) , COUNT('Table2'[Time to delivery]))
The result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @MishiAb
According to your description, you want to get the cumulative % based on the 'time to delivery' column to figure out how many items were delivered within a set timeframe.
This is my test data and my undersyand for your need:
We can create a measure like this :
Measure = DIVIDE( SWITCH( MAX('Table1'[Date type]) ,
"Week" , CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=7) ,
"Month",CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=31) ,
"6 Month",CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=186),
"Year" ,CALCULATE( COUNT('Table2'[Time to delivery]) ,'Table2'[Time to delivery]<=366)) , COUNT('Table2'[Time to delivery]))
The result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
User | Count |
---|---|
53 | |
28 | |
19 | |
18 | |
14 |
User | Count |
---|---|
92 | |
86 | |
39 | |
23 | |
22 |