Forum Discussion

TonyBI's avatar
TonyBI
Helper I
6 years ago
Solved

Comparing two fact tables

Hello my friend, I´d really appreciate some help regarding a data modeling issue. I´ll try to explain myself:   I have two fact tables that contain many items that I need to be able to compare. Tab...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi TonyBI ,

     

    Here's the thing, If we put Item column in Legend field then the Values field can contain only one column. So generally, we need to union these two table as one.

    My advice is to create a calculated table with below formula then create a measure and add it to visual filter to judge if the item is selected.

    Table = UNION('Item table','Refernce table')
    
    Measure = IF(SELECTEDVALUE('union'[Item]) in VALUES('Item table'[Item])||SELECTEDVALUE('union'[Item]) in VALUES('Refernce table'[Item]),1,0)

    Here's the result and the slicers are from two different fact tables.

    Pbix as attached.

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

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