Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
yannaing
Frequent Visitor

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?

1 ACCEPTED SOLUTION

Hi,

Thank you for your feedback.

Please check the below picture and the attached file.

It is for creating a new table.

 

Jihwan_Kim_0-1665476957010.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_0-1665472810195.png

 

 

New Table =
FILTER (
    'Daily Price',
    'Daily Price'[Date] IN DISTINCT ( 'Monday Price'[Date] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

yannaing_1-1665475568047.png

 

Do you have any other suggestions?

Hi,

Thank you for your feedback.

Please check the below picture and the attached file.

It is for creating a new table.

 

Jihwan_Kim_0-1665476957010.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you for you help, @Jihwan_Kim.

@yannaing You can create new table by writing this DAX code:

Table = SUMMARIZE(FILTER(DailyPriceTable,DailyPriceTable[Date]=RELATED(MondayPriceTable[Date])),DailyPriceTable[Date],DailyPriceTable[Category],"Daily Price", SUM(MondayPriceTable[Price]),"Monday Price",SUM(MondayPriceTable[Price]))
Capture.JPG

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 Thank you for your effort.
The RELATED() doesn't work in mine.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.