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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
chefe
Helper II
Helper II

Simple relationship does not work (1 fact table, 1 lookup table)

Hi there,

 

  • I have a data/fact table called "IR positions MTM", containing transactions data for several days, including a field which represents the date on which the transaction is settled.
  • Also, there is a date table (lookup table) "Calendar - settlement dates". Marked as Date table in SSDT.
  • I have connected both tables with a 1:many relationship. I made sure both fields are of type "date".

 

So far so good. However, the relationship does not seem to work. I don't know why.

 

There are two measures: 

 

  1. on the fact table itself using the MAX function to get the latest [period_settlement_date]
  2. on the date table, using the LASTDATE function (also tried the MAX function here, didn't work either)

The problem is that only #1 works. #2 always shows the absolutely last entry in the date table. Even trying LASTDATE(ALLSELECTED(...)) didn't work.

 

I have attached a screenshot to this setup below. Does anyone spot the problem? This is driving me crazy, far more complex calculations work, but this doesn't... 😕

 

Kind regards, chefe

 

2017-04-07 10_46_32-chec_spot_valuta.xlsx - Excel.png

 

 

 

 

 

3 REPLIES 3
chefe
Helper II
Helper II

P.S.: 

 

does it it matter where (on what table that is) the measure is stored?

Apparently not, have tried inputting the formulas into both tables as a measure. Doesn't work either.
Anonymous
Not applicable

Hi @chefe,

Could you please post expected result here?  Do you want to calculate max date of fact table using LASTDATE function? If so, please create measure using DAX below.

LastDate = LASTDATE(IR positions MTM[period_settlement_date])

Thanks,
Lydia Zhang

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.