Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
69 | |
48 | |
45 | |
18 | |
16 |