The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 | 39 |
Feb | 39 | |
Mar | 39 | |
Apr | 40.31 | 40.31 |
May | 40.31 | |
June | 44.97 | 44.97 |
July | 44.97 | |
Aug | 47.02 | 47.02 |
Sep | 49.13 | 49.13 |
Oct | 49.13 | |
Nov | 46.2 | 46.2 |
Dec | 46.2 |
Solved! Go to Solution.
@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
@Sudharsanan - try this at the power query back end data - Let me know if this fix, then accept it as a solution. Microsoft document on fill down Many Thanks
@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
Thanks @Manoj_Nair but am not sure what you are referring as a Lookup Table here. so pbix file will help me ?