Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

CONDITIONAL DATES

Hi,   I'm developing a daily report in Power BI, but if the user select a date where there´s no data, Power BI should select data from the last date with information:   CASE 1 - The user selected...
  • PaulDBrown's avatar
    PaulDBrown
    4 years ago

    Try:

    Sum Values =
    VAR MaxDate = MAXX(FILTER(ALL(Table[Date), Table[Date] <= SELECTEDVALUE(IndDate[Date]) && NOT(ISBLANK(SUM(Table[Values])))), Table[Date])
    
    RETURN
    
    CALCULATE(SUM(Table[Values]), FILTER(ALL(Table[Date]), Table[Date] = MaxDate)