Forum Discussion

Rubal_Islam's avatar
Rubal_Islam
Helper II
2 years ago
Solved

Need help with- Max Date vs Current Month

Hi Braintrust,

 

Need your help with the below DAX.

 

It is currently returning 1 or 0 if the date is  Max date.
However, I would like it to return 1 if the date is the current month and 0 for all the months from the selected months.

 

Last Sale Period =
VAR LastSale = CALCULATE(MAX(dim_date[full_date]), ALLSELECTED(fact_jedox_invoices))
RETURN
IF(
    DATE(YEAR(LastSale), MONTH(LastSale),1) =
    DATE(YEAR(MAX(dim_date[full_date])), MONTH(MAX(dim_date[full_date])),1),
    1, 0)
 
  • pls try

    if(year(max(dim_date[full_date]))=year(today())&&month(max(dim_date[full_date]))=month(today()),1,0)

3 Replies

  • pls try

    if(year(max(dim_date[full_date]))=year(today())&&month(max(dim_date[full_date]))=month(today()),1,0)