Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I need to create a measure that will SUM a sales value on a selected date, lets say 03/03/2018, then subtract the SUM of this same value on the selected date -1 day.
Any help appreciated.
Hi @Anonymous,
Can you share a sample please? That depends on how you will create your report.
The measure below could help.
Result = VAR lastday = CALCULATE ( SUM ( FactSales[SalesQuantity] ), FILTER ( ALL ( DimDate[Datekey] ), DimDate[Datekey] = MIN ( DimDate[Datekey] ) - 1 ) ) RETURN SUM ( FactSales[SalesQuantity] ) - lastday
Best Regards,
Dale
Thanks for your reply. Unfortunately your solution doesn't perform the subtraction.
For example:
My "SalesQuantity" for 05/03/2018 is -0.03097
My "SalesQuantity" for the proceeding date 02/03/2018 is -0.04047
The above should result in: 0.0095 (-0.03097 - -0.04047) but your measure results in -0.03 when 05/03/2018 is the selected date.
Thanks.