Forum Discussion
Power BI Date Column Issue
- 1 month ago
Hey howe-ch-6541,
I reproduced it with sample data (a Facts table + a Date Table built the same way, via CALENDAR(MIN/MAX('Facts'[Date])), related 1-to-many to Facts).
Root cause: The date mismatch is not your DAX or model issue. It is caused by having 'Date Table'[Date] and 'Facts'[Date] in the same visual once a measure is added. Time-intelligence measures need to be driven by the Date Table's column only. Adding the fact table's raw date column alongside it breaks the row alignment, which is exactly the repeating/mismatched pattern you saw.
Fix: Drop 'Facts'[Date] from the visual, use only 'Date Table'[Date]:
Measure:Rolling Avg 90 (Fixed) = CALCULATE( AVERAGE('Facts'[Result]), DATESINPERIOD('Date Table'[Date], MAX('Date Table'[Date]), -90, DAY) )I attached the PBIX file you can take a look.
Hey howe-ch-6541,
I reproduced it with sample data (a Facts table + a Date Table built the same way, via CALENDAR(MIN/MAX('Facts'[Date])), related 1-to-many to Facts).
Root cause: The date mismatch is not your DAX or model issue. It is caused by having 'Date Table'[Date] and 'Facts'[Date] in the same visual once a measure is added. Time-intelligence measures need to be driven by the Date Table's column only. Adding the fact table's raw date column alongside it breaks the row alignment, which is exactly the repeating/mismatched pattern you saw.
Fix: Drop 'Facts'[Date] from the visual, use only 'Date Table'[Date]:
Rolling Avg 90 (Fixed) =
CALCULATE(
AVERAGE('Facts'[Result]),
DATESINPERIOD('Date Table'[Date], MAX('Date Table'[Date]), -90, DAY)
)
I attached the PBIX file you can take a look.
- howe-ch-65411 month agoFrequent Visitor
Funny, I thought of the same thing at lunch today! You rock, thank you.