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 need to create a filter to determine the max date by employee ID for a table which has the following:
RVP | RDO | Location | DATE | Tech Name | Employee Number |
RVP 1 | RDO 1 | Norfolk | 1/16/2021 | Doe, John | 149531 |
RVP 1 | RDO 1 | Norfolk | 1/18/2021 | Doe, John | 149531 |
RVP 1 | RDO 1 | Norfolk | 12/29/2020 | Doe, John | 149531 |
RVP 1 | RDO 1 | Norfolk | 12/30/2020 | Doe, John | 149531 |
RVP 1 | RDO 1 | Norfolk | 12/31/2020 | Doe, John | 149531 |
RVP 1 | RDO 2 | VA Beach | 1/5/2021 | Morgan, Terry | 123456 |
RVP 1 | RDO 2 | VA Beach | 1/6/2021 | Morgan, Terry | 123456 |
RVP 1 | RDO 2 | VA Beach | 1/7/2021 | Morgan, Terry | 123456 |
RVP 1 | RDO 2 | VA Beach | 1/8/2021 | Morgan, Terry | 123456 |
I want to return the max date by employee number. I tried the following:
Max Date = MAX(MAX('Table','Table'[DATE])) and MAXX(MAX('Table','Table'[DATE]))
but that returned the date.
Any help would be appreciated. Thanks!
Solved! Go to Solution.
@ConnieMaldonado use this expression:
Max Date = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Employee Number] ) )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I got this to work. I was able to create a column for the hours and used your code above! Thanks! You're the best.
Max Date =
CALCULATE (
MAX ( 'Table'[Date] ),
ALLEXCEPT ( 'Table', 'Table'[Employee Number] ) ,
'Table'[Total Hours] > 0
)
@ConnieMaldonado if Total Hours is a column, make this change
Max Date =
CALCULATE (
MAX ( 'Table'[Date] ),
ALLEXCEPT ( 'Table', 'Table'[Employee Number] )
'Table'[Total Hours] > 0
)
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Unfortunately, Total Hours is a measure. I tried the statement above, but of course Total Hours is not allowed in the expression. I've tried several different things to no avail.
@ConnieMaldonado use this expression:
Max Date = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Employee Number] ) )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thank you - one more question. I have a measure to calculate Total Hours for each employee and would like to include a filter so that I'm calculating the max date for all the records for the employee for which Total Hours > 0. I have a filter on the visual, so I'm not sure why that doesn't work. Can I add a filter to the ALLEXCEPT statement?
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |