Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Everyone,
I am trying to create a bar graph where I can compare two dataset. If you see the attached file there is one bargraph. I need to show the blue and orange bar compared when PtoductName is selected. For example if I select Prod-1 then compare it prod-103. Currently the graph is showing blank. Is it doable?
Filter
Category | Subcategory | Brand | SubBrand | SKU | ProductName | Platform | ID | Type |
Cat1 | Sub-Cat1 | Brand146 | Sub-Brand1 | SKU-1 | Prod-1 | Plat-1 | 6155232121421391 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand1 | SKU-2 | Prod-2 | Plat-1 | 6152232121422401 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand1 | SKU-3 | Prod-3 | Plat-1 | 6152232121423871 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand2 | SKU-4 | Prod-4 | Plat-1 | 6152232151430271 | 0 |
Cat1 | Sub-Cat3 | Brand146 | Sub-Brand3 | SKU-5 | Prod-5 | Plat-1 | 6158232131441241 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand4 | SKU-6 | Prod-6 | Plat-1 | 6152232116315961 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand2 | SKU-7 | Prod-7 | Plat-1 | 6152232156319941 | 0 |
Cat1 | Sub-Cat4 | Brand146 | Sub-Brand5 | SKU-8 | Prod-8 | Plat-1 | 6154232146320831 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand4 | SKU-9 | Prod-9 | Plat-1 | 6152232116322571 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand4 | SKU-10 | Prod-10 | Plat-1 | 6152232116323911 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand4 | SKU-11 | Prod-11 | Plat-1 | 6152232116326311 | 0 |
Cat1 | Sub-Cat5 | Brand146 | Sub-Brand3 | SKU-12 | Prod-12 | Plat-1 | 6159232136374931 | 0 |
Cat1 | Sub-Cat2 | Brand146 | Sub-Brand4 | SKU-13 | Prod-13 | Plat-1 | 6152232116454521 | 0 |
Cat1 | Sub-Cat3 | Brand146 | Sub-Brand3 | SKU-14 | Prod-14 | Plat-1 | 6158232137502731 | 0 |
Cat1 | Sub-Cat6 | Brand146 | Sub-Brand6 | SKU-15 | Prod-15 | Plat-1 | 61511232177502961 | 0 |
Cat1 | Sub-Cat3 | Brand146 | Sub-Brand3 | SKU-16 | Prod-16 | Plat-1 | 6158232137503501 | 0 |
Cat1 | Sub-Cat4 | Brand117 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6154226701420231 | 1 |
Cat1 | Sub-Cat7 | Brand71 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6153226901420281 | 1 |
Cat1 | Sub-Cat4 | Brand117 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6154226701420311 | 1 |
Cat2 | Sub-Cat8 | Brand83 | Sub-Brand8 | SKU-20 | Prod-20 | Plat-1 | 6141226401420341 | 1 |
Cat2 | Sub-Cat8 | Brand83 | Sub-Brand8 | SKU-21 | Prod-21 | Plat-1 | 6141226401420371 | 1 |
Cat2 | Sub-Cat8 | Brand19 | Sub-Brand8 | SKU-22 | Prod-22 | Plat-1 | 6141227201420391 | 1 |
Cat1 | Sub-Cat4 | Brand137 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6154227301420401 | 1 |
Cat1 | Sub-Cat2 | Brand117 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6152226701420511 | 1 |
Cat2 | Sub-Cat8 | Brand19 | Sub-Brand8 | SKU-25 | Prod-25 | Plat-1 | 6141227201420581 | 1 |
Cat1 | Sub-Cat9 | Brand124 | Sub-Brand7 | Sub-Brand7 | Sub-Brand7 | Plat-1 | 6156228301420701 | 1 |
BarGraph
Client | Keyword | category | Subcategory | Brand | SubBrand | Platform | ProductName | Pincode | PlatformType | ClientProduct | Type | Discount | ID |
Client-1 | Keyword-1 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Prod-1 | 12345 | app | ClientProd-1 | 0 | 7 | 6155232121421391 |
Client-1 | Keyword-1 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Prod-2 | 12345 | app | ClientProd-1 | 0 | 7 | 6152232121422401 |
Client-1 | Keyword-1 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Prod-3 | 12345 | app | ClientProd-1 | 0 | 7 | 6152232121423871 |
Client-1 | Keyword-1 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Prod-4 | 12345 | app | ClientProd-1 | 0 | 7 | 6152232151430271 |
Client-1 | Keyword-1 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Prod-5 | 12345 | app | ClientProd-1 | 0 | 7 | 6158232131441241 |
Client-1 | Keyword-2 | Cat2 | Sub-Cat2 | Brand6 | Sub-Brand6 | Plat-2 | Prod-6 | 12346 | app | ClientProd-1 | 0 | 1 | 6152232116315961 |
Client-1 | Keyword-3 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Prod-7 | 12345 | app | ClientProd-1 | 0 | 10 | 6152232156319941 |
Client-1 | Keyword-3 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Prod-8 | 12345 | app | ClientProd-1 | 0 | 10 | 6154232146320831 |
Client-1 | Keyword-3 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Prod-9 | 12345 | app | ClientProd-1 | 0 | 10 | 6152232116322571 |
Client-1 | Keyword-3 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Prod-10 | 12345 | app | ClientProd-1 | 0 | 10 | 6152232116323911 |
Client-1 | Keyword-3 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Prod-11 | 12345 | app | ClientProd-1 | 0 | 10 | 6152232116326311 |
Client-1 | Keyword-4 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Prod-12 | 12345 | app | ClientProd-1 | 0 | 20 | 6159232136374931 |
Client-1 | Keyword-4 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Prod-13 | 12345 | app | ClientProd-1 | 0 | 20 | 6152232116454521 |
Client-1 | Keyword-4 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Prod-14 | 12345 | app | ClientProd-1 | 0 | 20 | 6158232137502731 |
Client-1 | Keyword-4 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Prod-15 | 12345 | app | ClientProd-1 | 0 | 20 | 61511232177502961 |
Client-1 | Keyword-4 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Prod-16 | 12345 | app | ClientProd-1 | 0 | 20 | 6158232137503501 |
Client-1 | Keyword-5 | Cat3 | Sub-Cat3 | Brand7 | Sub-Brand7 | Plat-3 | Sub-Brand7 | 12347 | app | ClientProd-1 | 0 | 8 | 6154226701420231 |
Client-1 | Keyword-6 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-3 | Sub-Brand7 | 12348 | app | ClientProd-1 | 0 | 7 | 6153226901420281 |
Client-1 | Keyword-6 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-3 | Sub-Brand7 | 12348 | app | ClientProd-1 | 0 | 7 | 6154226701420311 |
Client-1 | Keyword-6 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-3 | Prod-20 | 12348 | app | ClientProd-1 | 0 | 7 | 6141226401420341 |
Client-1 | Keyword-6 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-3 | Prod-21 | 12348 | app | ClientProd-1 | 0 | 7 | 6141226401420371 |
Client-1 | Keyword-6 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-3 | Prod-22 | 12348 | app | ClientProd-1 | 0 | 7 | 6141227201420391 |
Client-1 | Keyword-7 | Cat3 | Sub-Cat3 | Brand7 | Sub-Brand7 | Plat-3 | Sub-Brand7 | 12349 | app | ClientProd-1 | 0 | 9 | 6154227301420401 |
Client-1 | Keyword-8 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 5 | 6152226701420511 |
Client-1 | Keyword-8 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Prod-25 | 12350 | app | ClientProd-1 | 0 | 5 | 6141227201420581 |
Client-1 | Keyword-8 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 5 | 6156228301420701 |
Client-1 | Keyword-8 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 5 | 6154228401420721 |
Client-1 | Keyword-8 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 5 | 6154226701420731 |
Client-1 | Keyword-9 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Prod-29 | 12351 | app | ClientProd-1 | 0 | 3 | 6141228601420751 |
Client-1 | Keyword-9 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Prod-30 | 12351 | app | ClientProd-1 | 0 | 3 | 6141228701420761 |
Client-1 | Keyword-9 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Prod-31 | 12351 | app | ClientProd-1 | 0 | 3 | 6141229101420811 |
Client-1 | Keyword-9 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Sub-Brand7 | 12351 | app | ClientProd-1 | 0 | 3 | 6156206301420821 |
Client-1 | Keyword-9 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Sub-Brand7 | 12351 | app | ClientProd-1 | 0 | 3 | 6156195001420831 |
Client-1 | Keyword-10 | Cat1 | Sub-Cat1 | Brand1 | Sub-Brand1 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 4 | 6156229601420941 |
Client-1 | Keyword-10 | Cat1 | Sub-Cat1 | Brand4 | Sub-Brand4 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 4 | 6154229801420961 |
Client-1 | Keyword-10 | Cat1 | Sub-Cat1 | Brand3 | Sub-Brand3 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 4 | 6156229901420981 |
Client-1 | Keyword-10 | Cat1 | Sub-Cat1 | Brand2 | Sub-Brand2 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 4 | 6153230101421001 |
Client-1 | Keyword-10 | Cat1 | Sub-Cat1 | Brand5 | Sub-Brand5 | Plat-1 | Sub-Brand7 | 12350 | app | ClientProd-1 | 0 | 4 | 6153230401421031 |
I couldnt attched the PDF so pasting the dashboard and graph here. THe Type 0 produntName has type 0 filtered and type 1 product name has type 1 filtered. Let me know if you have any other queries.
Hi @Surekha_PM,
I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.
Please continue using Microsoft community forum.
Thank you,
Pavan.
Hi @Surekha_PM,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, kindly "Accept as Solution" and give it a 'Kudos' so others can find it easily.
Thank you,
Pavan.
Hi @Surekha_PM,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept as Solution" and give a 'Kudos' so other members can easily find it.
Thank you,
Pavan.
Hi @Anonymous
Thank you so much for your response. I truly appreciate you taking the time to reply back with a solution. However, I tried doing it, but the many-to-one relationship is giving me an error for other filters. Is there any other way to do it?
Regards,
Hi @Surekha_PM,
Thank you for reaching out in Microsoft Community Forum.
Pleaase follow below steps to resolve the error;
1. Please Delete the Many-to-Many relationship between the Filter and BarGraph tables.
2. Use TREATAS to establish a virtual relationship between the tables in the measures themselves:
Dataset1_Value =
CALCULATE(
SUM('Filter'[Type]),
TREATAS(
VALUES('BarGraph'[ProductName]),
'Filter'[ProductName]
)
)
Dataset2_Value =
CALCULATE(
SUM('BarGraph'[Type]),
TREATAS(
VALUES('Filter'[ProductName]),
'BarGraph'[ProductName]
)
)
3. use clustered bar chart with x-axis as product name and y-axis as Dataset1_Value and Dataset2_Value
Please continue using Microsoft community forum.
If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.
Regards,
Pavan.
Hi @Surekha_PM,
Thank you for reaching out in Microsoft Community Forum.
Please follow below to create a bar graph to compare two datasets based on the ProductName selection in Power BI:
1. Please Establish a Many-to-Many relationship between the Filter and BarGraph tables using the ProductName column.
2. Please Use a Slicer visual with the ProductName column from the Filter table to select the product you want to compare.
3. Define two measures to sum the Type values from both tables based on the selected ProductName using below DAX
Dataset1_Value = CALCULATE(SUM('Filter'[Type]), FILTER('Filter', 'Filter'[ProductName] IN VALUES('BarGraph'[ProductName])))
Dataset2_Value = CALCULATE(SUM('BarGraph'[Type]), FILTER('BarGraph', 'BarGraph'[ProductName] IN VALUES('Filter'[ProductName])))
4.Add a Clustered Bar Chart with ProductName on the X-axis and dataset1_Value and Dataset2_Value on the Y-axis.
This displays two bars for each product--Blue bar → Filter table and Orange bar → BarGraph table
Please continue using Microsoft community forum.
If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.
Regards,
Pavan.