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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Babu34
New Member

undefined

Hi

I want to display number of requests on monthly basis by year and by service type( I have two service types) 

In simpler terms

x axis - Month

y axis - Measure

legend - Year and Service type

 

how to achieve this requirement. If any visual didn't support this type of formatting please suggest me the alternate way to do this

2 ACCEPTED SOLUTIONS
v-pgoloju
Community Support
Community Support

Hi @Babu34,

 

Power BI doesn’t let you use two separate legends (like one for Year and one for Service Type) in the same chart.

But you can work around this by combining both into one as suggested by @Royel . Just create a new column that joins Year and Service Type together, like this:

YearService = FORMAT([RequestDate], "YYYY") & " - " & [ServiceType]

This way, your legend will show values like "2023 - Type A" or "2024 - Type B", and you can compare them easily in one chart.

 

Thanks & Regards,

Prasanna Kumar

View solution in original post

Royel
Responsive Resident
Responsive Resident

@Babu34 Lets try something new, We can create a "Dynamic Legend with Parameter" and use it in the visual. 

Steps: 

1. Go to Modeling tab → New parameter → Fields

2. Add both "Year" and "ServiceType" fields to the parameter

3. Ceates a slicer that allows users to switch between viewing by Year or by Service Type
4. Now create a line or Clustered Column Chart where legend item is the new parameter. 
Let me know how it goes. 

 

View solution in original post

9 REPLIES 9
v-pgoloju
Community Support
Community Support

Hi @Babu34,

 

Just following up to see if the responses provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

 

Best regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Babu34,

 

Just following up to see if the solutions provided by community members were helpful in addressing the issue.

If one of the responses helped resolve your query, please consider marking the perticular response as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Babu34,

 

Power BI doesn’t let you use two separate legends (like one for Year and one for Service Type) in the same chart.

But you can work around this by combining both into one as suggested by @Royel . Just create a new column that joins Year and Service Type together, like this:

YearService = FORMAT([RequestDate], "YYYY") & " - " & [ServiceType]

This way, your legend will show values like "2023 - Type A" or "2024 - Type B", and you can compare them easily in one chart.

 

Thanks & Regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Babu34,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @Royel  and @FBergamaschi  for their prompt and helpful responses.

 

Just following up to see if the solutions provided by community members were helpful in addressing the issue.

If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

I didnt find any solution as helpful as of now. My goal is to achieve the comparison across two legends. If i cant achieve it please suggest me any alternative solution for that

Royel
Responsive Resident
Responsive Resident

@Babu34 Lets try something new, We can create a "Dynamic Legend with Parameter" and use it in the visual. 

Steps: 

1. Go to Modeling tab → New parameter → Fields

2. Add both "Year" and "ServiceType" fields to the parameter

3. Ceates a slicer that allows users to switch between viewing by Year or by Service Type
4. Now create a line or Clustered Column Chart where legend item is the new parameter. 
Let me know how it goes. 

 

Royel
Responsive Resident
Responsive Resident

Hi @Babu34 , you can achieve this by choosing a Clustered Column Chart

Steps:

  1. Create a calculated column: Year_ServiceType = [Year] & " " & [ServiceType]
  2. Drag Month to X-axis
  3. Drag Request Count to Values
  4. Drag the new Year_ServiceType field to Legend

This will give you clustered bars for each month, with different colors representing each year-service combination.


If you find this helpful please mark my post as the solution, it helps others with the same challenge find the answer!

Babu34
New Member

I m already using a clustered column chart where I m showing month on X axis and Number of requests on Y axis and Year as legend. Now i want it to be stacked by both year and service type which means i have to add one more field into legend group which is not achieveable to me. Please give me your inputs on this

FBergamaschi
Solution Sage
Solution Sage

You can use a line chart or a bar chart, it will work

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors