Forum Discussion

TylerVono's avatar
TylerVono
Helper III
3 years ago
Solved

Column Comparison - Workaround - Manage Relationship

Hello, I am trying to compare two columns in separate tables. Here is the story:

 

Table 1: Demand Seg - Is the master list of all parts we manufacture with.

 

Table 2: Stocking Report - Is the master list of all the parts we have suppliers stock for us.

 

I want to compare the two as a pie chart to see what items of ALL items we use, are stocked.

 

Here is the caveot I can only DirectQuery the Demand Seg, but I am importing the stocking report.

 

I simply want to have a table and a pie chart to tell me what items are stocked and what are not, but I receive this error:

 

Here are my relationships to prove it, does anyone know a workaround?

A roadblock is that I cannot adjust the below screenshot relationship between a table called PO Data and the Demand Seg, since I have to DirectQuery, I am forced in this configuration:

 

Any help is greatly appreciated.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi TylerVono ,

    Please create a new calculated column:

     

    Stocking Agreement? = 
    IF (
        ISBLANK (
            CALCULATE (
                COUNTROWS ( 'Demand Seg' ),
                'Demand Seg'[Item Number] = EARLIER ( 'Stocking Report'[Item Number] )
            )
        ),
        "No",
        "Yes"
    )

     

    Output:

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

2 Replies

  • Hello TylerVono ,

     

    The best practice is to build this model as a star schema model. then you'll have a dimension table for items that will be connected to both tables you have here and then you could easily work with both tables together viewed throught the dimension fields.

     

    check the star schema concept https://learn.microsoft.com/en-us/power-bi/guidance/star-schema

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

    Follow me on Linkedin

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi TylerVono ,

    Please create a new calculated column:

     

    Stocking Agreement? = 
    IF (
        ISBLANK (
            CALCULATE (
                COUNTROWS ( 'Demand Seg' ),
                'Demand Seg'[Item Number] = EARLIER ( 'Stocking Report'[Item Number] )
            )
        ),
        "No",
        "Yes"
    )

     

    Output:

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum