Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
ryan_b_fiting
Post Patron
Post Patron

Finding the 'Current' Status based on most

Hello Community - 
 
We want to report for the last day of each historical month how many people were in each state. If that data looked like this (for a single learner):
 
LearnerId      Status       UpdateDate
000001          Enrolled   2020-04-01
000001          LOA          2020-05-14
000001          Dismissed 2020-07-20

 

This is the expected output I would want to see:

 

Date      Enrolled      LOA      Dismissed
2020-04      1              0               0
2020-05      0              1               0
2020-06      0              1               0
2020-07      0              0               1

 

What would be the most efficient way to write this to get the 'current' status based on the most recent update date within a specific period/date.

 

As always, thanks for your input!

Ryan F.

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi , @ryan_b_fiting 

Could you please tell me whether your problem has been solved?
If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

 

Best Regards,
Community Support Team _ Eason

v-easonf-msft
Community Support
Community Support

Hi , @ryan_b_fiting 

I made a sample file,  it  can meet your requirements.

The result will show as below:

85.png

For more details ,please refer to the sample file

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@ryan_b_fiting , have month year, either in your table or date table and use a measure like

lastnonblankvalue(Date[Month-Year],count(Table[Status]))

 

Month year = format([Date],"YYYY-MM")

 

 

 

Greg_Deckler
Super User
Super User

@ryan_b_fiting - Sounds like a modification of Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

Probably also have to use a disconnected table as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.