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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Compare two columns form different Table

Hi ,
I have two different tables table1 has category and table 2 has category and sub category In Power BI, I want the result to be shown in as
1.compare sales and qty column as category and subCategory in one column (i.e. in output image I have created 2 different column chart I want it as one )how can I get it by DAX
2.category name should come first(from left) on axis
sharing some images for better understanding

Prajakta11_0-1657634610668.png

 

Prajakta11_2-1657634670160.png

Prajakta11_4-1657634757716.png

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

 I did a test using similar data to yours, and I wonder if this is what you are trying to achieve?

vmengzhumsft_0-1657879126145.png

Compare their respective sales and QTY with category  and sub-category as X-axis?

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

HIi @Anonymous , I am wondering why you need to the two tables in the data model.  The Sub-Category contains all the data need to create the two visuals you have shown.  If you are trying to add a reconciliation between the two tables, I would recommend using Power Query to compare the two tables.  If there is an issue, then report this exception in Power BI.

If you want to compare using DAX, you will need to create Bridging Tables for Date and Category.  These tables can then be joined to both tables.  When they are joined, these table will apply filters to both tables.  You will be able to compare the Sum of table 1 to Sum of table 2, and calculate a difference.  Please watch the following GuyInACube video to understand this:  Handling MULTIPLE fact tables in Power BI - YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.