Forum Discussion

WhaleWatcher222's avatar
1 year ago
Solved

Measure showing future actuals based on Slicer | Filter selection

Hi Expert   I cannot get the folllowing measure to Show actuals based on the filter selection.    New Actuals = IF(HASONEVALUE('Date'[Month]) && HASONEVALUE('Date'[Year]), CALCULATE( SU...
  • rohit1991's avatar
    1 year ago

    Hi WhaleWatcher222 ,
    The issue seems to be with how filters are being handled in your measure. Although you're using REMOVEFILTERS to clear filters on the dataset and budget name, you're not explicitly filtering the date range to only include dates up to the selected month. Instead of relying on HASONEVALUE, consider using a more dynamic approach where you determine the latest selected date and then filter the data accordingly. You can use a measure like:

    New Actuals = 
    VAR MaxSelectedDate = MAX('Date'[Date])
    RETURN 
    CALCULATE(
        SUM('Financial Datasets'[Amount]),
        'Financial Datasets'[Dataset] = "Actual",
        'Date'[Date] <= MaxSelectedDate
    )
    

    This way, it will only sum actuals up to the selected month, respecting the context of your slicer or filter.