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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TomasPac
Helper I
Helper I

How to add filtered values to the legend of the chart

Hello, not sure how to phrase this, but will try to tell everything as clear as I can. 

I have one table with a column where all of the sales is stored. Theres another column telling me what kind of sale this is.

For example: 100$ wood 

                     200$ metal

                     150$ employee

                     50$ work uniform

what I need is a chart with a legend consisting different kinds of sale but also together by type. For example chart would show me two columns side by side but one column represents $ sum of materials(wood and metal and etc..) another column represents $ sum of people, for example (employee and work uniform etc..). 

 

5 REPLIES 5
parry2k
Super User
Super User

@TomasPac you can achieve byfollowing:

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I cannot, maybe I need to be more specific. My table has column with values of sales(many cells of numbers in them) those sales has a relationship with another tables column name "code"(many cells with codes in them). All sales are on the same column and they are not filtered, so as the codes. I need to filter sales by code. But the problem is that I need diferent codes for different columns in a chart. For example I have a column chart and 1st column represents materials, their codes are (620,621,622 etc.), the 2nd column is people, and people codes are (420,421,422 etc.), so what I need is a lagend which would have different items but those items are combined values from code column, which I could combine manually. 

@TomasPac you need to add type column in your table based on the business rule you have and then it should be ok, something like this.

 

Type = IF( Table[Code] > 600, "Material", "People" )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

It seems like part of the solution, the logic would be that the value "Materials" has to hold the array of codes in "code" column for example there should appear column named materials and in that column values like 6200, 6201, 6202 and so on.. 


@parry2k wrote:

@TomasPacyou need to add type column in your table based on the business rule you have and then it should be ok, something like this.

 

Type = IF( Table[Code] > 600, "Material", "People" )

 

@TomasPac whatever business logic you need to use, add that to the condition. Overall solution is to add column for Type and then use it in visuals. Do you need further help?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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