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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Last Result based on Date Hierarchy

Hi ,

Need some help in getting last Date based on dates only  removing all other filters

 

Sample Date table

Year       Period          Status       Date            
2019         1                  X             1/1/2019        

2019         1                  X             1/31/2019        
2019         2                  X             2/28/2019     

2019         3                  X             3/31/2019     

2019         4                  A             4/1/2019       

2019         4                  X             4/5/2019      

 

Desired Output  at period level

Year       Period          Status       Date                   

2019         1                  X             1/31/2019        
2019         2                  X             2/28/2019     

2019         3                  X             3/31/2019          

2019         4                  X             4/5/2019 

       

I am getting this result if i don't add status column but as soon as i add status column its giving  output  at period level based  on status too

Year       Period          Status       Date                  

2019         1                  X             1/31/2019        
2019         2                  X             2/28/2019     

2019         3                  X             3/31/2019     

2019         4                  A             4/1/2019   

2019         4                  X             4/5/2019 

 

Thanks

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

Hello,

To address your issue in Power BI where the addition of the 'Status' column is altering the expected output, you need to create a measure that will return the last date in each period without being influenced by the 'Status' column. This can be achieved by using DAX functions that ignore the 'Status' filter.

Here is a step-by-step guide to creating the desired measure:

1. Create a New Measure: Go to your Power BI report, select the table where your date data resides, and create a new measure. This can be done by right-clicking on the table in the fields pane and selecting 'New measure'.

2. DAX Formula for the Measure:
You can use the following DAX formula to create a measure that will return the last date in each period, regardless of the 'Status' column:


LastDateIgnoringStatus =
CALCULATE(
MAX('Table'[Date]),
ALLEXCEPT('Table', 'Table'[Year], 'Table'[Period])
)

View solution in original post

1 REPLY 1
technolog
Super User
Super User

Hello,

To address your issue in Power BI where the addition of the 'Status' column is altering the expected output, you need to create a measure that will return the last date in each period without being influenced by the 'Status' column. This can be achieved by using DAX functions that ignore the 'Status' filter.

Here is a step-by-step guide to creating the desired measure:

1. Create a New Measure: Go to your Power BI report, select the table where your date data resides, and create a new measure. This can be done by right-clicking on the table in the fields pane and selecting 'New measure'.

2. DAX Formula for the Measure:
You can use the following DAX formula to create a measure that will return the last date in each period, regardless of the 'Status' column:


LastDateIgnoringStatus =
CALCULATE(
MAX('Table'[Date]),
ALLEXCEPT('Table', 'Table'[Year], 'Table'[Period])
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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