The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
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
@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.
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
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
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
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
@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.
Hi @Babu34 , you can achieve this by choosing a Clustered Column Chart
Steps:
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!
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
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