Forum Discussion

IAA's avatar
IAA
Helper I
6 years ago
Solved

Dateadd with filter/if statement?

Dear community, I have a problem with the following:  I am creating a cashflow forecast, which is shown in the picture below. The idea is that when the parameter is 2, the date of paying/recevi...
  • v-kelly-msft's avatar
    6 years ago

    Hi IAA

     

    Create a slicer table as below:

    Slicer Table = DISTINCT('Value by date 2'[Category])

    Then create a measure as below:

    Measure = 
     IF(MAX('Value by date 2'[Category]) in FILTERS('Slicer Table'[Category]),CALCULATE ( AVERAGEX(FILTER(ALL('Value by date 2'),'Value by date 2'[Category]=SELECTEDVALUE('Slicer Table'[Category])), 'Value by date 2'[Value]),DATEADD( DimDate[Date], [Value Parameter], DAY)),CALCULATE(AVERAGE('Value by date 2'[Value]),
        DATEADD( DimDate[Date], [Value Parameter], DAY)))

    Finally you will see:

    For details,pls see attached.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!