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.
Hello everybody, please your assistance with this issue.
We have a table Table1 that has a date column and has a relationship with a date table. We have a measure Measure1 over Table1 that sums a column ColumnA like:
Measure1 := sum(Column1)
Now, if we fix Measure to give the calculation for a specific date like Calculate(Measure1, dateColumn = date(2020,11,27)) is all working perfect.
But if we do Calculate(Measure1, dateColumn = max(dateColumn)) its give error and if we use a variable like
var variable1 = max(dateColumn)
Calculate(Measure1, dateColumn = variable1) , it gives the measure for all dates, not for the max when is filtered for the date table.
We tried using filter, variables with same result. It’s some dax logic that we are overlooking?
Please, thanks to all in advance
Solved! Go to Solution.
@Lenastray , Try like
Calculate(Measure1, filter( Table, Table[dateColumn] = max(Table[dateColumn])))
@Lenastray , Allexpcept or allselected need to used
Calculate([Measure1], filter( allselected(Table) , Table[dateColumn] = max(Table[dateColumn])))
or
Calculate([Measure1], filter( Table, Table[dateColumn] = max(Table[dateColumn])) , allexcept(Table, Table[COl1])
Thanks a lot, I use a minimum modification that resolve the issue
@Lenastray , Allexpcept or allselected need to used
Calculate([Measure1], filter( allselected(Table) , Table[dateColumn] = max(Table[dateColumn])))
or
Calculate([Measure1], filter( Table, Table[dateColumn] = max(Table[dateColumn])) , allexcept(Table, Table[COl1])
@Lenastray , Try like
Calculate(Measure1, filter( Table, Table[dateColumn] = max(Table[dateColumn])))
Ty amitchandak, but it returns the measure for all dates in date column. columnDate is a column from Table1 and its filtered by the date column of the date table. The problems I see is at the context transition. max() says give me the max over the current filter conext, but when is filtered by the date table, for max the max table is the current date for all the rows of the date column of the date table.
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 |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |