Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all, i would like to retrieve the data of the latest date of every year.
Below is an example of what i want to achieve:
MyTable:
After:
Hopefully someone can guide me through. Thank you!
Solved! Go to Solution.
Hi @huihui,
Based on my test, you should be able to follow steps below to get your expected result.
1. Use the formula below to add a calculate column in your table to indicate if the current date if the latest date of its year.
IsLatestDateofYear = VAR currentYear = YEAR ( MyTable[date] ) VAR latestDateofYear = CALCULATE ( MAX ( MyTable[date] ), FILTER ( ALL ( MyTable ), YEAR ( MyTable[date] ) = currentYear ) ) RETURN IF ( MyTable[date] = latestDateofYear, 1, 0 )
2. Then you should be able to use this calculate column as a Slicer on the report to retrieve the data of the latest date of every year.
Regards
Hi @huihui,
Based on my test, you should be able to follow steps below to get your expected result.
1. Use the formula below to add a calculate column in your table to indicate if the current date if the latest date of its year.
IsLatestDateofYear = VAR currentYear = YEAR ( MyTable[date] ) VAR latestDateofYear = CALCULATE ( MAX ( MyTable[date] ), FILTER ( ALL ( MyTable ), YEAR ( MyTable[date] ) = currentYear ) ) RETURN IF ( MyTable[date] = latestDateofYear, 1, 0 )
2. Then you should be able to use this calculate column as a Slicer on the report to retrieve the data of the latest date of every year.
Regards
Omg thanks it works! But i am not sure why when i use that column to as a filter, i show no results though.
User | Count |
---|---|
93 | |
83 | |
77 | |
70 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |