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,
I am trying to create a measure which I can use to filer to create a table that only includes rows for the latest(largest) week for the most recent year.
For example, the correct output below should be the first three rows having latest week column as 1 and the rest as 0.
The calculated column is what outputs using the following code:
Thank you very much for your help.
Solved! Go to Solution.
Hi:
The other members are giving you a table for the records for the latest week. What are you missing?
This is another table function to give you the same type of table:
@Whitewater100 right??? I provided the DAX and a screen snip showing exactly the intended outcome...
Hi @knajar
This will create a table that contains the only the records for the top week in the most recent year
Calculated Table =
VAR MostRecentYear =
CALCULATE(
MAX(RawData[Year]),
ALL(RawData)
)
VAR LargestWeek =
TOPN(
1,
FILTER(
ALL(RawData),
RawData[Year] = MostRecentYear
),
RawData[WeekNumber],
DESC
)
RETURN
LargestWeek
Hope this helps!
Hello,
Thank you for the reply. When I tried this solution I get the following error:
"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
Thank you very much for the response. It worked.
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |