Forum Discussion

Sudharsanan's avatar
Sudharsanan
Icon for Helper III rankHelper III
3 years ago
Solved

Need to fill blank rows with previous month value

Hi All,   Could someone help me with the below scenerio please? The blank row should have the previous months value as shown in the expected column.   Month Price Expected Result Jan  39...
  • Manoj_Nair's avatar
    Manoj_Nair
    3 years ago

    Sudharsanan - Let me know if this DAX-based solution meets your requirement, then I'll post the pbix file.

    LookupTable = FILTER('Price Table', 'Price Table'[Price] >0)
    Derived Price = 
    VAR currmonth = MAXX(FILTER(LookupTable, LookupTable[MonthNumber] <= SELECTEDVALUE('Price Table'[MonthNumber])),LookupTable[MonthNumber])
    VAR result = CALCULATE(MAX('LookupTable'[Price]), LookupTable[MonthNumber] = currmonth)
    return result