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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Surekha_PM
Helper III
Helper III

Comparing two data sets

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?
Screenshot 2025-03-24 150739.png

Filter

CategorySubcategoryBrandSubBrandSKUProductNamePlatformIDType
Cat1Sub-Cat1Brand146Sub-Brand1SKU-1Prod-1Plat-161552321214213910
Cat1Sub-Cat2Brand146Sub-Brand1SKU-2Prod-2Plat-161522321214224010
Cat1Sub-Cat2Brand146Sub-Brand1SKU-3Prod-3Plat-161522321214238710
Cat1Sub-Cat2Brand146Sub-Brand2SKU-4Prod-4Plat-161522321514302710
Cat1Sub-Cat3Brand146Sub-Brand3SKU-5Prod-5Plat-161582321314412410
Cat1Sub-Cat2Brand146Sub-Brand4SKU-6Prod-6Plat-161522321163159610
Cat1Sub-Cat2Brand146Sub-Brand2SKU-7Prod-7Plat-161522321563199410
Cat1Sub-Cat4Brand146Sub-Brand5SKU-8Prod-8Plat-161542321463208310
Cat1Sub-Cat2Brand146Sub-Brand4SKU-9Prod-9Plat-161522321163225710
Cat1Sub-Cat2Brand146Sub-Brand4SKU-10Prod-10Plat-161522321163239110
Cat1Sub-Cat2Brand146Sub-Brand4SKU-11Prod-11Plat-161522321163263110
Cat1Sub-Cat5Brand146Sub-Brand3SKU-12Prod-12Plat-161592321363749310
Cat1Sub-Cat2Brand146Sub-Brand4SKU-13Prod-13Plat-161522321164545210
Cat1Sub-Cat3Brand146Sub-Brand3SKU-14Prod-14Plat-161582321375027310
Cat1Sub-Cat6Brand146Sub-Brand6SKU-15Prod-15Plat-1615112321775029610
Cat1Sub-Cat3Brand146Sub-Brand3SKU-16Prod-16Plat-161582321375035010
Cat1Sub-Cat4Brand117Sub-Brand7Sub-Brand7Sub-Brand7Plat-161542267014202311
Cat1Sub-Cat7Brand71Sub-Brand7Sub-Brand7Sub-Brand7Plat-161532269014202811
Cat1Sub-Cat4Brand117Sub-Brand7Sub-Brand7Sub-Brand7Plat-161542267014203111
Cat2Sub-Cat8Brand83Sub-Brand8SKU-20Prod-20Plat-161412264014203411
Cat2Sub-Cat8Brand83Sub-Brand8SKU-21Prod-21Plat-161412264014203711
Cat2Sub-Cat8Brand19Sub-Brand8SKU-22Prod-22Plat-161412272014203911
Cat1Sub-Cat4Brand137Sub-Brand7Sub-Brand7Sub-Brand7Plat-161542273014204011
Cat1Sub-Cat2Brand117Sub-Brand7Sub-Brand7Sub-Brand7Plat-161522267014205111
Cat2Sub-Cat8Brand19Sub-Brand8SKU-25Prod-25Plat-161412272014205811
Cat1Sub-Cat9Brand124Sub-Brand7Sub-Brand7Sub-Brand7Plat-161562283014207011


BarGraph

ClientKeywordcategorySubcategoryBrandSubBrandPlatformProductNamePincodePlatformTypeClientProductTypeDiscountID
Client-1Keyword-1Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Prod-112345appClientProd-1076155232121421391
Client-1Keyword-1Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Prod-212345appClientProd-1076152232121422401
Client-1Keyword-1Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Prod-312345appClientProd-1076152232121423871
Client-1Keyword-1Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Prod-412345appClientProd-1076152232151430271
Client-1Keyword-1Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Prod-512345appClientProd-1076158232131441241
Client-1Keyword-2Cat2Sub-Cat2Brand6Sub-Brand6Plat-2Prod-612346appClientProd-1016152232116315961
Client-1Keyword-3Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Prod-712345appClientProd-10106152232156319941
Client-1Keyword-3Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Prod-812345appClientProd-10106154232146320831
Client-1Keyword-3Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Prod-912345appClientProd-10106152232116322571
Client-1Keyword-3Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Prod-1012345appClientProd-10106152232116323911
Client-1Keyword-3Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Prod-1112345appClientProd-10106152232116326311
Client-1Keyword-4Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Prod-1212345appClientProd-10206159232136374931
Client-1Keyword-4Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Prod-1312345appClientProd-10206152232116454521
Client-1Keyword-4Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Prod-1412345appClientProd-10206158232137502731
Client-1Keyword-4Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Prod-1512345appClientProd-102061511232177502961
Client-1Keyword-4Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Prod-1612345appClientProd-10206158232137503501
Client-1Keyword-5Cat3Sub-Cat3Brand7Sub-Brand7Plat-3Sub-Brand712347appClientProd-1086154226701420231
Client-1Keyword-6Cat1Sub-Cat1Brand1Sub-Brand1Plat-3Sub-Brand712348appClientProd-1076153226901420281
Client-1Keyword-6Cat1Sub-Cat1Brand3Sub-Brand3Plat-3Sub-Brand712348appClientProd-1076154226701420311
Client-1Keyword-6Cat1Sub-Cat1Brand2Sub-Brand2Plat-3Prod-2012348appClientProd-1076141226401420341
Client-1Keyword-6Cat1Sub-Cat1Brand5Sub-Brand5Plat-3Prod-2112348appClientProd-1076141226401420371
Client-1Keyword-6Cat1Sub-Cat1Brand4Sub-Brand4Plat-3Prod-2212348appClientProd-1076141227201420391
Client-1Keyword-7Cat3Sub-Cat3Brand7Sub-Brand7Plat-3Sub-Brand712349appClientProd-1096154227301420401
Client-1Keyword-8Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Sub-Brand712350appClientProd-1056152226701420511
Client-1Keyword-8Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Prod-2512350appClientProd-1056141227201420581
Client-1Keyword-8Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Sub-Brand712350appClientProd-1056156228301420701
Client-1Keyword-8Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Sub-Brand712350appClientProd-1056154228401420721
Client-1Keyword-8Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Sub-Brand712350appClientProd-1056154226701420731
Client-1Keyword-9Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Prod-2912351appClientProd-1036141228601420751
Client-1Keyword-9Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Prod-3012351appClientProd-1036141228701420761
Client-1Keyword-9Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Prod-3112351appClientProd-1036141229101420811
Client-1Keyword-9Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Sub-Brand712351appClientProd-1036156206301420821
Client-1Keyword-9Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Sub-Brand712351appClientProd-1036156195001420831
Client-1Keyword-10Cat1Sub-Cat1Brand1Sub-Brand1Plat-1Sub-Brand712350appClientProd-1046156229601420941
Client-1Keyword-10Cat1Sub-Cat1Brand4Sub-Brand4Plat-1Sub-Brand712350appClientProd-1046154229801420961
Client-1Keyword-10Cat1Sub-Cat1Brand3Sub-Brand3Plat-1Sub-Brand712350appClientProd-1046156229901420981
Client-1Keyword-10Cat1Sub-Cat1Brand2Sub-Brand2Plat-1Sub-Brand712350appClientProd-1046153230101421001
Client-1Keyword-10Cat1Sub-Cat1Brand5Sub-Brand5Plat-1Sub-Brand712350appClientProd-1046153230401421031


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.

Surekha_PM_0-1742809318400.png

 




6 REPLIES 6
Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

Surekha_PM
Helper III
Helper III

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,

Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors