Forum Discussion
Month to Date Null Issue
Try the below measure
MTD sales Corporate =
VAR LatestDate = MAX('Lease Ledgers'[Lease Created On])
VAR currentMonthStart = DATE(YEAR(LatestDate), MONTH(LatestDate), 1)
VAR SalesAmount =
CALCULATE(
SUM('Lease Ledgers'[Fin Amt '000']),
FILTER(
'Lease Ledgers',
'Lease Ledgers'[Lease Created On] >= currentMonthStart &&
'Lease Ledgers'[Lease Created On] <= LatestDate &&
'Lease Ledgers'[corp or retail] = "CORPORATE"
)
)
RETURN
IF(
ISBLANK(SalesAmount),
0,
SalesAmount
)
In this version, I introduced a variable SalesAmount to store the calculated sales amount. This helps simplify the logic and ensures that the ISBLANK check is applied directly to the calculated sales amount. This should help in returning zero when there are no sales for the current month.
Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!
Hi Saud,
Thanks for the reply but still I get the issue, V1 is your one (Replaced your DAX her, in here i get previous months data in this table.