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
prokurors
Advocate III
Advocate III

How to display data in clustered column chart - when working with date data

I'm a bit stuck, with something that feels should be quite simple - so I hope somebody can help me with this.

 

Basically I've got a table with sales data statistics:

ProductId, SalesDate and GrossSalesValue

 

This table holds data for a few years and I need to present side by side performance this year vs last year.

 

In Excel creating such a chart is very simple (see screenshot at the end of this post). I see that it takes two columns - one for 2016. year and second for 2017. year. But my table holds one field for GrossSalesValue and other for dates. Can I get from such a table clustered column chart to compare year data side by side? Can I achieve this with measures and DAX? I've tried TOTALYTD and Calculate(...; SamePeriodLastYear), but it didn't work

power-bi-stacked-charts.PNG

2 ACCEPTED SOLUTIONS
Sean
Community Champion
Community Champion

Do you have a Calendar table?

If you do place the date on the axis and keep only the month from the resulting  Hierarchy,

then drag the date field again but this time to the legend and keep only the year.

 

If no Calendar just break your date field into Month and Year columns and use those...

 

Place Month on the Axis, Year in the Legend and sales in the Values

 

Good Luck!Smiley Happy

View solution in original post

v-yulgu-msft
Employee
Employee

Hi @prokurors,

 

As Sean suggested, I could get the chart output like below. In my test, I didn't use calendar table, just select Month from date hierarchy as Axis, and select Year from date hierarchy as legend.
1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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-yulgu-msft
Employee
Employee

Hi @prokurors,

 

As Sean suggested, I could get the chart output like below. In my test, I didn't use calendar table, just select Month from date hierarchy as Axis, and select Year from date hierarchy as legend.
1.PNG

 

Best regards,
Yuliana Gu

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

Do you have a Calendar table?

If you do place the date on the axis and keep only the month from the resulting  Hierarchy,

then drag the date field again but this time to the legend and keep only the year.

 

If no Calendar just break your date field into Month and Year columns and use those...

 

Place Month on the Axis, Year in the Legend and sales in the Values

 

Good Luck!Smiley Happy

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.