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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
birdie29
Helper II
Helper II

Max date from a table with one critera

Hello

 

I would like a measure or a column that shows the the max date in my date table (called 'Time') but where another critera is fulfilled ie in the example below, where the financial period status is 0.

 

DateFinancialPeriodStatusLatest Reporting Date
01/01/2017 00:00131-Dec-25
31/12/2016 00:00031-Dec-16

 

I'm currently using the below formula, however this is not filtering the FinancialPeriodStatus by 0 so in the above example I would want the top row, last column to say 31-Dec-16 not 31-Dec-25

 

Latest Reporting Date = calculate(max('TIME'[Date]),allexcept('TIME','TIME'[FinancialPeriodStatus]))

 

Can anyone help please?

 

Thank you

Chris

1 ACCEPTED SOLUTION
Birdjo
Resolver II
Resolver II

Hello @birdie29,

 

Maybe you can try this.

Date = CALCULATE(MAX('TIME'[Date]) ; 'TIME'[FinancialPeriodStatus]="0")

View solution in original post

5 REPLIES 5
BetterCallFrank
Resolver IV
Resolver IV

For the overall latest reporting date try

Max Latest Reporting Date = 
CALCULATE(
  MAX('TIME'[Date]);
  ALL('TIME');
  'TIME'[FinancialPeriodStatus]=0
)

HTH,

Frank

Hi @BetterCallFrank

 

Thanks for your quick response! I'm not sure I could get this to work based on your example. I think the issue is with the ALL('TIME'); 'TIME'[FinancialPeriodStatus]=0 ) part.

 

The previous answer from Birdjo has worked, however thank you very much for taking the time to respond.

 

Chris

Hi Again

 

Apologies for bringing this topic up again, however although I can get the measure of this date I would really like a column with the date instead. Does anyone know how I could do this?

 

Thank you

Chris

Birdjo
Resolver II
Resolver II

Hello @birdie29,

 

Maybe you can try this.

Date = CALCULATE(MAX('TIME'[Date]) ; 'TIME'[FinancialPeriodStatus]="0")

Hi @Birdjo

 

Perfect, thank you! I thought the solution would be a simple one but not that simple!

 

Chris

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.