Forum Discussion

Alizee's avatar
Alizee
Frequent Visitor
4 years ago
Solved

How to highlight unmatching data based on date fields from different tables

Hello,   I have two different tables : Placements and Invoices and basically, the goal of the report is to highlight placements that does not have an invoice on a given month despite the fact that ...
  • v-jingzhang's avatar
    4 years ago

    Hi Alizee 

     

    You may first download the attached PBIX to see whether this is close to what you want. 

    I created two measures in the report. The first measure is to play as a visual-level filter on the left table so the table will only show placements whose date begin dates are earlier than the selected month and date end dates are after the selected month. 

    Date Flag = IF(SELECTEDVALUE('Placement Table'[Date Begin])<MIN('Date'[Date])&&SELECTEDVALUE('Placement Table'[Date End])>MAX('Date'[Date]),1,0)

    The second measure is to decide colors for different scenarios. I didn't consider the scenario with ORANGE color as currently the left table show placements whose (start date ~ end date) range can cover the selected month. As a result the placements that meet the third condition will not show. 

    Color = 
    VAR _itemCodes = VALUES('Invoice Table'[Item Code])
    RETURN
    SWITCH(TRUE(),SELECTEDVALUE('Placement Table'[Placement ID]) IN _itemCodes, "GREEN","RED")

     

    If you want to show the third condition placements in the left table, I'll remove the first measure filter on it and modify the color measure. Let me know your expected result. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.