Forum Discussion

cbhh76's avatar
cbhh76
Regular Visitor
6 years ago
Solved

TotalYTD weird behaviour

Hello all,   I ran into a weird behaviour of TOTALYTD   . I used the following measure for the YTD column:   YTD Forecast = TOTALYTD([Forecast];Period[DateToUseInMeasures].[Date]) I hav...
  • cbhh76's avatar
    cbhh76
    6 years ago

    Thank you again, AlB 

     

    My initial pbix did't reflect the original as PLAN does have values for every month.

    So I needed some sort of IF function.

    I did a search on SUMIF equivalents in DAX and found this post here which was helpful

     

    https://community.powerbi.com/t5/Desktop/SUMIF-Equivalent-in-DAX/td-p/230727

     

    I then changed the Forecast Function to this 

     

    Forecast = SUMX(Tabelle;IF(Tabelle[ACT] = BLANK();CALCULATE(SUM(Tabelle[PL]));CALCULATE(SUM(Tabelle[ACT]))))

    This solved the issue and gave both correct Totals and correct YTD.

     

    So thank you again AlB  and Thanks TomMartens