Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I have a table that I would like to find the last record and specifically show the "Closed Month" Field. The measure should only display the word Oct-2021 because that is the last record with the "Closed" column set to Yes based on the DateKey.
Measure = CALCULATE(MAX(FY[Closed Month]),ALL(FY),FY[Closed] = "Yes") Doesnt work.
Does anyone lknow how to achieve this?
Hi @lcasey ,
According to your needs, you want to get the latest records based on the "Yes" in the Closed column. I did the following test: note that ALLSELECT function keeps the slicer external filter and the created measure is added to the Card to return the latest record under “Yes”.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@lcasey I don't why you are using ALL() in your measure
try this, it doesn't work share sample data:
Measure = CALCULATE(MAX(FY[Closed Month]),KEEPFILTERS(FY[Closed] = "Yes"))
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
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.
@lcasey, Test as
Medidas ?
var _max - MAXX(filter(Allselected(FY),FY[Closed] á "Yes"), FY[DateKey])
devolución
CALCULATE(MAX(FY[Closed Month]),Filter(Allselected(FY), FY[Closed] á "Yes" && [DateKey] á _max))
O
Medidas ?
var _max - MAXX(filter(all(FY),FY[Closed] á "Yes"), FY[DateKey])
devolución
CALCULATE(MAX(FY[Closed Month]),Filter(all(FY), FY[Closed] á "Yes" && [DateKey] á _max))
is your [Closed Month] field a text field or a Date field? It needs to be a Date field if you want the logic to work - you can still format it in the way you need.
The [Date Key] field is equally suspicious. Use actual numbers like 202001 instead of text "2020-1".
Its a text field. I ended up using a table as the slicer so I can show the months that are closed:
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |