Forum Discussion

Mathoosala's avatar
Mathoosala
Icon for Microsoft Employee rankMicrosoft Employee
2 years ago
Solved

Create a visual that compares two tables and highlights the differences

I'm learning Power BI so excuse my inexperience. I have two tables, TableA & TableB. The sources of these two tables are Start.csv & End.csv.  They both have the same columns, Location, Color, Count....
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Mathoosala ,

    I assume in case you are trying to compare counts with Location, Color consistent. try creating these measures:

    Count A = SUM('TableA'[Count])
    Count B = 
    VAR __cur_location = SELECTEDVALUE('TableA'[Location])
    VAR __cur_color = SELECTEDVALUE('TableA'[Color])
    VAR __result = CALCULATE(SUM('TableB'[Count]),'TableB'[Location]=__cur_location && 'TableB'[Color]=__cur_color)
    RETURN
    __result
    Measure = IF([Count A]<>[Count B],"yellow")

    Please apply [Measure] to the background conditional formatting of each field of the table visual.

    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--China Power BI User Group