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.
Need help to create a table containing products with MAX (latest) year week. Not all products have the same MAX year week. Desired results are below,
Source Table: Results Table:
Year week Product Year week Product
201848 A 201848 A
201848 B 201848 B
201847 A 201847 C
201847 B
201847 C
I am using Power BI Desktop - need a DAX solution or M code. Maybe an "IsMax" flag and a filter..
Solved! Go to Solution.
The DAX formula depends on the table structure. But assuming you have one table of data loaded in power BI called Table then just do this
create a table visual on a report page
drag the Table[Product] Column to the table visual
write a measure = max(Table[Year Week])
place the measure in the table visual
HI, @Anonymous
After my research, you could use EARLIER to calculate the max year week for each Product and then mark an "IsMax" flag for filter.
For example:
TAG = IF( CALCULATE(MAX('Table'[Year week]),FILTER('Table','Table'[Product]=EARLIER('Table'[Product] )))='Table'[Year week],"IsMax","IsNotMax")
Then use this column to filter data.
Best Regards,
Lin
HI, @Anonymous
After my research, you could use EARLIER to calculate the max year week for each Product and then mark an "IsMax" flag for filter.
For example:
TAG = IF( CALCULATE(MAX('Table'[Year week]),FILTER('Table','Table'[Product]=EARLIER('Table'[Product] )))='Table'[Year week],"IsMax","IsNotMax")
Then use this column to filter data.
Best Regards,
Lin
The DAX formula depends on the table structure. But assuming you have one table of data loaded in power BI called Table then just do this
create a table visual on a report page
drag the Table[Product] Column to the table visual
write a measure = max(Table[Year Week])
place the measure in the table visual
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 |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |