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

How to create Clustered Column chart with multiple year dimensions

 

I want to show the number of items created by year and number of items closed by year on the same clustered column chart. How can I do that?

 

Capture.JPG

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @sanman 

Both of the above solutions can successfully achieve what you want. I illustrate both in my understanding with images below in case you need it.

Solution 1:

1. In query editor, select CreateYear and ClosedYear columns and unpivot them.

v-jingzhang_0-1599817747435.jpeg

2. Create a clustered column chart like below.

v-jingzhang_1-1599817747443.jpeg

 

Solution 2:

1. Create a year table, then create an active relationship ‘Items (2)CreateYear(*) – ‘YearYear(1) and an inactive relationship Items (2)ClosedYear(*) – ‘YearYear(1).

091023.jpg

2. Create a measure using Userelationship function as below.

 

Count of Closed = CALCULATE(COUNTROWS('Items (2)'),USERELATIONSHIP('Items (2)'[ClosedYear],'Year'[Year]))

 

3. Create the clustered column chart.

091024.jpg

 

Best Regards,

Community Support Team _ Jing Zhang

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @sanman 

Both of the above solutions can successfully achieve what you want. I illustrate both in my understanding with images below in case you need it.

Solution 1:

1. In query editor, select CreateYear and ClosedYear columns and unpivot them.

v-jingzhang_0-1599817747435.jpeg

2. Create a clustered column chart like below.

v-jingzhang_1-1599817747443.jpeg

 

Solution 2:

1. Create a year table, then create an active relationship ‘Items (2)CreateYear(*) – ‘YearYear(1) and an inactive relationship Items (2)ClosedYear(*) – ‘YearYear(1).

091023.jpg

2. Create a measure using Userelationship function as below.

 

Count of Closed = CALCULATE(COUNTROWS('Items (2)'),USERELATIONSHIP('Items (2)'[ClosedYear],'Year'[Year]))

 

3. Create the clustered column chart.

091024.jpg

 

Best Regards,

Community Support Team _ Jing Zhang

amitchandak
Super User
Super User

@sanman , Create a year table join it with both Create year and close year. One will active another one will be inactive. Use userelation to in the measure to change date

 

This video has an HR example - but applies here too -

https://youtu.be/e6Y-l_JtCq4

Refer

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Greg_Deckler
Super User
Super User

@sanman - I *think* you need to unpivot your year columns. Use Attribute as the legend, Value as the axis. Count of itemname for value


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.