Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Compare only Matched Date Value

Having two fact tables that has one-to-many relationship with Calendar table.
One table contains data with daily price (category would not be considered) and other table with the Monday date price data.

 

Monday Price Table

DatePrice

9/5/2022

100

9/12/2022

103
9/19/2022107
9/26/2022105
10/3/2022102
10/10/2022108

 

Daily Price Table

DateCategoryPrice
9/5/2022Vege60
9/6/2022Fruit67
9/7/2022Vege78
9/8/2022Fruit67
9/9/2022Vege66
9/10/2022Fruit80
9/11/2022Vege50
9/12/2022Fruit74
9/13/2022Fruit58
9/14/2022Vege58
9/15/2022Vege63
9/16/2022Vege52
9/17/2022Fruit71
9/18/2022Fruit63
9/19/2022Vege78
9/20/2022Fruit71
9/21/2022Fruit78
9/22/2022Vege64
9/23/2022Vege52
9/24/2022Fruit63
9/25/2022Vege75
9/26/2022Fruit51
9/27/2022Vege59
9/28/2022Fruit56
9/29/2022Fruit76
9/30/2022Vege50
10/1/2022Vege76
10/2/2022Vege60
10/3/2022Fruit55
10/4/2022Fruit59
10/5/2022Vege79
10/6/2022Fruit60
10/7/2022Vege74
10/8/2022Fruit76

 

I would like to make comparison of this two tables by taking the value that have only matched with Monday Price Table.

 

Can I get some help that how to write DAX that only return data from Daily Price Table that is matching Date from Monday Price Table?
And what about if we only have the random Date data instead of every Monday data?

  • Hi,

    Thank you for your feedback.

    Please check the below picture and the attached file.

    It is for creating a new table.

     

     

     

     

6 Replies

  • Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

    It is for creating a new table.

     

     

     

    New Table =
    FILTER (
        'Daily Price',
        'Daily Price'[Date] IN DISTINCT ( 'Monday Price'[Date] )
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jihwan_Kim Thank you for your effort.

      I have tried this in Google Sheet and what I expected would be as below.

      But I am struggling to be done it in Power BI.

       

      Do you have any other suggestions?

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Icon for Super User rankSuper User

        Hi,

        Thank you for your feedback.

        Please check the below picture and the attached file.

        It is for creating a new table.