Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All-
I have a measure that is used to calulcate the last date record before a specific date. This measure works correctly as long as all of my fields are from the original table. However, if I add a field from a dimension table (relationship 1-many) the two tables duplicate all the values. The relationship also works fine when I do not have the measure added.
My Measure is:
Is Last Before Selection =
var tbl1 = CALCULATETABLE(Filter(FactForecasts2, FactForecasts2[Date] <= [Selected Allocation Date]), ALLEXCEPT(FactForecasts2, FactForecasts2[Item], FactForecasts2[Group]))
var maxDate = MAXX(tbl1, [Date])
return calculate(maxDate = Max([Date]))
Selected Allocation Date is also a measure getting the date from a slicer:
Selected Allocation Date = VALUES(Dates[Date])
On the report in Power BI I have 3 visuals.
The data that I have created is pretty simple.
DimProducts
| Group | Description |
| Group1 | Description 1 |
| Group2 | Description 2 |
FactForecasts
| Group | Item | Date | Qty | Other |
| Group1 | Item1 | 44927 | 100 | X |
| Group1 | Item1 | 45078 | 110 | Y |
| Group1 | Item1 | 45200 | 90 | Z |
| Group1 | Item2 | 45078 | 80 | A |
| Group1 | Item2 | 45170 | 70 | B |
| Group2 | Item1 | 44928 | 101 | XX |
| Group2 | Item1 | 45079 | 102 | YY |
| Group2 | Item1 | 45201 | 103 | ZZ |
Dates (For the slicer)
| Date |
| 1/15/2023 |
| 7/15/2023 |
| 10/15/2023 |
Thanks in advance for any insight.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 23 | |
| 16 | |
| 15 | |
| 14 | |
| 8 |