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
Anonymous
Not applicable

cumulative line chart in percent till 100 %

Hi Power BI Community,

line chart.PNG

I need to show a line chart with the y -axis in percent and x - axis days 
 My first quastion: How can I make the delivery days from 0 to ten days on the x - axis?

Second and bigger quastion: I want a cumilated line chart that shows when all is delivered = 100 %  like this for example but with days not units:

 

425783.image0.jpg

 



Thank you for your time!

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my understanding, you want to set 0-5,5-15,15-30,30-45... as X-axis ,the sum of percentage as Y-axis, and the cumulative percentage over date as the secondary Y-axis, right?

 

You could add Rank column and then switch it to create the Units column for X-axis like this:

 

Rank =
RANKX ( 'Table', [Date],, ASC, DENSE )
Units =
IF (
    [Rank] >= 1
        && [Rank] < 5,
    "0-5",
    IF (
        [Rank] >= 5
            && [Rank] < 15,
        "5-15",
        IF (
            [Rank] >= 15
                && [Rank] < 30,
            "15-30",
            IF ( [Rank] >= 30 && [Rank] < 45, "30-45" )
        )
    )
)

Here is my table output:

 

1.7.3.1.PNG

 

Then use the following formula to calculate the cumulative percentage:

Measure =
CALCULATE (
    SUM ( 'Table'[Percentage] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)

In addition, in order for the x-axis to be displayed in the correct order, put the Rank to Tooltip pane.

 

The final output is shown below:

1.7.3.2.PNG

Please kindly take a look at the pbix file.

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my understanding, you want to set 0-5,5-15,15-30,30-45... as X-axis ,the sum of percentage as Y-axis, and the cumulative percentage over date as the secondary Y-axis, right?

 

You could add Rank column and then switch it to create the Units column for X-axis like this:

 

Rank =
RANKX ( 'Table', [Date],, ASC, DENSE )
Units =
IF (
    [Rank] >= 1
        && [Rank] < 5,
    "0-5",
    IF (
        [Rank] >= 5
            && [Rank] < 15,
        "5-15",
        IF (
            [Rank] >= 15
                && [Rank] < 30,
            "15-30",
            IF ( [Rank] >= 30 && [Rank] < 45, "30-45" )
        )
    )
)

Here is my table output:

 

1.7.3.1.PNG

 

Then use the following formula to calculate the cumulative percentage:

Measure =
CALCULATE (
    SUM ( 'Table'[Percentage] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)

In addition, in order for the x-axis to be displayed in the correct order, put the Rank to Tooltip pane.

 

The final output is shown below:

1.7.3.2.PNG

Please kindly take a look at the pbix file.

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , if day is a column then you can create a static bucket. If measure then you need to do dynamic Segmentation

 

For % of Cumm total, you have try a measure

divide(calculate([Gt count], filter(allselected(Table), Table[days] <= max(Table[days] ))), calculate([Gt count], allselected(Table)))

 

segmentation

https://www.youtube.com/watch?v=CuczXPj0N-k

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-power-query/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

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.