Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Rajsheisan
Frequent Visitor

Create a chart to show Jan - December and selected month

Hi,

 

Would anyone help me create a chart  to show yearly data from Jan - Dec and another line to show the selected month data. if two months get selected then the line should increase up to correct month selected. Currently, the selected month is shown as a small circle.

Thanks.

Capture.PNG




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

Hi  @Rajsheisan ,You can refer the following links to get the culmulative values base on the selected months...

Cumulative total based on the selected month

First of all, we can create a spreated calculated table as the slicer, 

SlicerTable = DISTINCT('Table'[Month])

Then we can use a measure in visual filter to meet your requirement:

Cumulative Size = CALCULATE(SUM('Table'[Size]), FILTER(ALLSELECTED('Table'),[Month]<=SELECTEDVALUE('Table'[Month]))) 

 yingyinr_0-1657537263072.jpeg

Computing running totals in DAX

RT Sales Customer Class :=
VAR CurrentCustomerClass = SELECTEDVALUE ( Customer[Customer Class Number] )
RETURN
    CALCULATE (
        [Sales Amount],
        Customer[Customer Class Number] <= CurrentCustomerClass,
        ALL ( Customer[Customer Class] )
    )

Cumulative Running Total Based on Highest Value

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi  @Rajsheisan ,You can refer the following links to get the culmulative values base on the selected months...

Cumulative total based on the selected month

First of all, we can create a spreated calculated table as the slicer, 

SlicerTable = DISTINCT('Table'[Month])

Then we can use a measure in visual filter to meet your requirement:

Cumulative Size = CALCULATE(SUM('Table'[Size]), FILTER(ALLSELECTED('Table'),[Month]<=SELECTEDVALUE('Table'[Month]))) 

 yingyinr_0-1657537263072.jpeg

Computing running totals in DAX

RT Sales Customer Class :=
VAR CurrentCustomerClass = SELECTEDVALUE ( Customer[Customer Class Number] )
RETURN
    CALCULATE (
        [Sales Amount],
        Customer[Customer Class Number] <= CurrentCustomerClass,
        ALL ( Customer[Customer Class] )
    )

Cumulative Running Total Based on Highest Value

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.