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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate last 6 months sales value using temporary date table

Hey there! I'm diving into DAX and trying to visualize the sales for the last 6 months. I've got this Date_Master table and made a copy named temp_date_master.. The relationship between the Date_Master and Temp_Date_Master was many-to-one. (The video explaining the process ). I have done the following measure

Last_6_Months_Sales = 
var referenceDate = Max('Date Master'[Date])
var referenceDate1 = EOMONTH(referenceDate, -1)
var previousDates = 
    DATESINPERIOD('Temp_Date_Master'[Date],
    referenceDate1 ,
    -6,
    MONTH
    )
VAR Result = 
    CALCULATE(
        [Sales Value],
        REMOVEFILTERS('Date Master'),
        KEEPFILTERS(previousDates),
        USERELATIONSHIP('Date Master'[Date], 'Temp_Date_Master'[Date]))

Return 
    Result

I wanted to convert the relationship between the date_master and temp_date_master to be one-to-many relationship (I am trying it as im losing hierarchy of 'Date Master'[Date] as the column is the "many" side of a model relationship). How to solve this issue?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

If you madea copy of  Date_Master and created Temp_Date_Master then the relationship should be one-to one. Not sure why you try to chage it to  one-to-many

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

If you madea copy of  Date_Master and created Temp_Date_Master then the relationship should be one-to one. Not sure why you try to chage it to  one-to-many

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy Thanks for your suggestion. I have made the relationship one-to-one bidirectional and its working fine. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.