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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
turp111
Frequent Visitor

Keeping some rows and hiding others after certain date

Good morning all,

 

I've been working on a PBI report for quite some time and the last feature before I'm considered 'Done' is giving me the hardest time.  I think this will need to be done using DAX.  I have the following example.  What needs to happen is: I need to keep the first transaction for each employee after the MAS Effective Date.  This is the FIRST DATE...as you can see I have that captured.  So the Trade Date that matches the FIRST DATE is what I need to always keep.  No matter what, I need to keep that transaction.  The difficult part in all this is that I need to keep some of the subequent transactions but not all.  For example: on the first employee, I would need to keep the ACH Contributions but not the Reallocations.  For Employee B, I don't need to keep any of subsequent transactions.  I can add a column that would indicate HIDE or KEEP, but that's where I'm hung up.  How can I do this and indicate that I only need some of the types of transactions?  Hopefully this wasn't too confusing.  The pic below is an export of what I have in Power BI for simple display purposes.  Thanks!

 

help submission.jpg

1 REPLY 1
amitchandak
Super User
Super User

@turp111 , Try a new column like

 

new column =

var _min = minx(filter(Table, [First Name] = earlier([First Name])  && [Last Name] = earlier([Last Name]) ), [Trade Date])

return

if(_min = [TRade Date] || [Trans Desc] ="ACH Contributions" , "Keep", "HIDE")

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.