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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
gwright15
Helper I
Helper I

Date table with multi relationships

I am hoping for some help with date tables - i'm new to PowerBI

 

I have a table, with 4 main date fields - add_date, Won_date, lost_date and latest_date.

 

I would like to report revenue based on the first three date. I have been using the USERELATIONSHIP function to switch relationships and this seems to be working.

 

However, the revenue value is the base currency rather than GBP, which is causing me the issue.

 

I have an exchange rate table, which is looking up the currency and latest_date for the correct ex-rate rate.

However, as they are using the same date table, it's not working, as we can only change the active relationship one it seems. I have got around this introducing a second date table, linking the Latest_date to this date table. However, this doesn't feel like best practice having multi date tables.

 

Please help!

3 REPLIES 3
parry2k
Super User
Super User

@gwright15 based on your input, you don't need 2nd date table, you are correct that you can have only one active relationship, it is if you are connecting same table on multiple dates, which you are already doing and using userrelationship function

 

You should able to have active relationship between your date table and fx rate table, not sure why you are not able to create active relationship between these two tables.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for your help.

 

Does anything look wrong with this code, which would prevent these relationship working?

 

 

Exchange Rate = 
VAR
    RevisedDate = Filter( All(Date_Ex_Rate[Date]),
                            Date_Ex_Rate[Date] > Max ( Date_Ex_Rate[Date] ) -5 && Date_Ex_Rate[Date] <= Max(Date_Ex_Rate[Date] ) )

RETURN

Calculate (Exchange_Rates_GBP[Ex-Rate],
LASTNONBLANK(RevisedDate, Exchange_Rates_GBP[Ex-Rate]),USERELATIONSHIP('Date'[Date],Date_Ex-Rate[Date])
)
Deal_Value_Add_Time = Calculate(sum(deals[value]),USERELATIONSHIP('Date'[Date],deals[Add_Time_Local]),USERELATIONSHIP(deals[user_id],users[id]),NOT(deals[status]="deleted"))
Deal_Value_Add_Time_GBP = Sumx(deals,deals[Deal_Value_Add_Time]/Exchange_Rates_GBP[Exchange Rate])

 

 

Thanks again for your help!

 

@gwright15 if you can share sample pbix/data will make it easy to look into it.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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