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
erdinch
Helper I
Helper I

Weekly graph data and YTD data in one chart

Hello,

I am having one monthly measure refelected in bar chart and target shown as line.  That measure1 is calculated based on data in table1.

at the end of the same graph I would like to have YearToDate data. As I do not know how to do that currently I am using second graph that is showing the data on a yearly basis.Unfortunately it does not look nice. Could you please advice me how to incorporate both bars in one graph?

measure1.JPG

Thanks

 

1 ACCEPTED SOLUTION

Hi,

 

Please try to create a new table by Enter Data:

1.PNG

Create the relationship with original table by one-to-many:

2.jpg

Then create a measure:

Measure 2 = IF(MAX('Table (2)'[Month])="TotalAverage",CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table')),SUM('Table'[Sales]))

Choose the new table's [Month] and this measure as clustered column chart.

If you want to sort Month from 'January' to 'December', please add an index column in Query Editor.

After Apply&Close, sort [Month] by [Index], the result shows:

2.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

5 REPLIES 5
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a table to test:

51.PNG

Then create a measure:

Measure = IF(MAX('Table'[Date].[Month])="January"||MAX('Table'[Date].[Month])="February",SUM('Table'[Sales]),IF(MAX('Table'[Date].[Month])="December",CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table')),0))

Choose Clustered Column Chart, and it shows:

52.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

Hello,

Thanks for the hint but it should be altered slighly. What I need is cummulative data to be shown AFTER December. So if we have data for Jan (239) and Feb (260) at the end after Dec. There should be new YTD column showing 499. like in the pic below:

2020_02_12Capture.JPG

 

 

Hi,

 

Please try to create a new table by Enter Data:

1.PNG

Create the relationship with original table by one-to-many:

2.jpg

Then create a measure:

Measure 2 = IF(MAX('Table (2)'[Month])="TotalAverage",CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table')),SUM('Table'[Sales]))

Choose the new table's [Month] and this measure as clustered column chart.

If you want to sort Month from 'January' to 'December', please add an index column in Query Editor.

After Apply&Close, sort [Month] by [Index], the result shows:

2.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

can i get video of steps how its done

 

amitchandak
Super User
Super User

Not a direct way I am away of, But you can try a new table using summarize and do it

 

new table = union(summarize(table,table[Month],"Value",sum(table[Value])),summarize(table,table[Month],"Value",[YTD Value]))

 

Assumed you have ytd formula outside

Use this to display that chart

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.