Power Query formula to get the Today and Yesterday Sale values

Below formulas can be used to get only the Today and Yesterday Sale value in columns

Today Sale value:
TodaySale = if [Date]=  DateTime.Date(DateTime.LocalNow()) then [SaleValue] else null

Yesterday Sale value:
YesterdaySale = if [Date]=  Date.AddDays(DateTime.Date(DateTime.LocalNow()),-1) then [SaleValue] else null

Hope this will be helpful.

No comments:

Post a Comment

How to run UPDATE/INSERT/DELETE Statements on Azure SQL Database in Microsoft Fabric Notebook...

You can run UPDATE/INSERT/DELETE Statements on Azure SQL Database in Microsoft Fabric Notebook using Python SQL Driver - pyodbc.  For the Fa...