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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Arif270182
Helper II
Helper II

Date Mapping - comparison (current year vs last year)

Good Evening 

 

I am looking support to understand how we i can map date for day to day comparision 

example :- 01st Jan 2019 mapped to 01st Jan 2018 ; 02nd Jan 2019 mapped to 03rd Jan 2018 (Same day - same week) 

 

i have table build for date mapping - All i need is to build connection between table to show me Current year vs Last Year 

below are my 2 tables I have data for 2018 & 2019 by per day hereI have data for 2018 & 2019 by per day herethis is mapping of dates - 2019 - 2018this is mapping of dates - 2019 - 2018

Looking for support 

5 REPLIES 5
Greg_Deckler
Super User
Super User

Having a little trouble understanding exactly what you are trying to do here but if you have 2018 in one table and 2019 in another table then you should be able to connect your CurrentYearDate to your DOB in 2019 table and LastYearDate to your DOB in your 2018 table. Is that what you are going for or do you have 2018 and 2019 dates in a single table? If that is the case, then you could form 2 relationships and the use USERELATIONSHIP in your calculations to determine which relationship to use.

 

Looks like you are trying to do same store sales or something similar. I would suggest ditching the mapping entirely and letting machine learning do the the job for you. 🙂


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Super User 

 

 

 

Hi @Arif270182,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

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

Hi Support 

 

Apologies for late reply - No this one still not working 😞 

 

will share more details soon 

Hi @Arif270182,

 

I was going to recreate the date table. But I found @Greg_Deckler's idea is great due to you already have the mapped dates. Please download the demo from the attachment. 

1. Create two relationships.

Date-Mapping-comparison-current-year-vs-last-year

2. Create a measure.

Measure =
DIVIDE (
    SUM ( FactTable[Value] ),
    CALCULATE (
        SUM ( FactTable[Value] ),
        USERELATIONSHIP ( DateMapping[LastYearMapDate], FactTable[DOB] )
    )
)

Date-Mapping-comparison-current-year-vs-last-year-2

 

Best Regards,
Dale

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.