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
Karthik12
Post Patron
Post Patron

Table Visualization from 2 different tables

Hello Folks,

GM. 

I am developing a production data display whereas data comes from 2 different tables.

I would like consolidate in one matrix/table visualization as below

 

Expected format (Filer applied as today) :

Karthik12_0-1672040041634.png

 

Input files : Table 1 

Karthik12_1-1672040076016.png

Table 2 :

Karthik12_2-1672040107523.png

 

Can anybody help me, how to do this?

 

Thanks a lot in advance.

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Here's my suggestion

  1. Rename the Qty columns to Quantity in both tables
  2. Insert Type column with entries as Production and Plan in each table
  3. Append the tables
  4. Write these measures
    1. Pl_qty = sum(Data[Plan])
    2. Pr_qty = sum(Data[Production])
    3. Gap = [Pr_qty]-[Pl_qty]

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi  @Karthik12 ,

 

Here are the steps you can follow:

1. Create calculated column.

Production Qty =
COUNTX(FILTER(
    ALL('Table1'),
    CONTAINSSTRING(
    CONCATENATEX(
    'Table1','Table1'[Type],","),'Table'[Type])=TRUE()
    &&
    'Table1'[Type]=EARLIER('Table'[Type])
    ),[Type])
Plan Qty =
COUNTX(FILTER(
    ALL('Table2'),
    CONTAINSSTRING(      
    CONCATENATEX(
    'Table2','Table2'[Type],","),
    'Table'[Type]  
    )=TRUE()
    &&
    'Table2'[Customer]=EARLIER('Table'[Type])
    ),'Table2'[Type])
Gap =
[Production Qty] - [Plan Qty]

vyangliumsft_0-1672113795541.png

2. Create measure.

Flag =
IF(
    MAX('Table'[Gap] ) <0,"red","green")

3. [Gap] – Conditional formatting – Background color.

vyangliumsft_1-1672113795542.png

vyangliumsft_2-1672113795543.png

4. Result:

When your entire Row is null, it will automatically default not to display.

vyangliumsft_3-1672113795544.png

If you want to display null values, you can click Show items with no data.

vyangliumsft_4-1672113795545.png

vyangliumsft_5-1672113795545.png

 

Best Regards,

Liu Yang

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

@Anonymous Hi , Thanks for your time.

It working fine but we have plan qty and prod qty is more than 1 (in table 1 and table 2) means this logic not working.

Is there any solution for that?

AbbasG
Memorable Member
Memorable Member

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

One of ways to solve this is to create a Type dimension table like below.

I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_3-1672041185445.png

 

 

Jihwan_Kim_2-1672041173796.png

 

Jihwan_Kim_4-1672041401079.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim I working for me. Thank you !🙂

But only thing, If Gap color is not working. If Gap > 0, it should be green, <0, it should RED.

Can you please check?

 

Also, my table has lot of other names like below

Is it possible to show only rows which has either plan or prod qty numbers?

 

Karthik12_0-1672055879931.png

 

Hi,

Thank you for your feedback.

Please share your sample pbix file's link (onedrive or others), and then I can try to look into it to come up with a more accurate solution.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.