Forum Discussion
Rubal_Islam
2 years agoHelper II
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
- ryan_mayuSuper User
pls try
if(year(max(dim_date[full_date]))=year(today())&&month(max(dim_date[full_date]))=month(today()),1,0)
- Rubal_IslamHelper II
hi Ryan, it works fine. thank you soo much for your help. legend.
- ryan_mayuSuper User
you are welcome