Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All
Im trying in Power BI to create a report with yesterdays sales compared to the same day last year.
I managed to make a report showing the sale from day this year and the sale from the same day last year.
I got them sorted by our stores. Så i have the stores in rows and the 2 dates in the columns with their sales. Now i want a third column with the difference between the 2 numbers, and i cant figure out how to do that - everything i have tried that gets remotely close to what i want to achieve makes an column with a difference after the 2015 date and the 2016 date - i only want a single column at the end showing the difference.
STORE-->SALES YESTERDAY-->SALES SAME DAY LAST YEAR-->DIFFERENCE BETWEEN
I tried searching for a solution but cant find one that comes close enough to what i want to achieve.
Hope somebody can help.
Generally, we can make the dataset with columns of Date, Store and Sales as below.
Then we can create a calculated column “Diff_PY_Sales” with following formula to get the difference of sales between day this year and the same day last year.
Diff_PY_Sales = VAR PY_Sales = CALCULATE ( SUM ( Table1[Sales] ), SAMEPERIODLASTYEAR ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Store] ) ) RETURN ( IF ( SAMEPERIODLASTYEAR ( Table1[Date] ) <> BLANK (), Table1[Sales] - PY_Sales, BLANK () ) )
Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
82 | |
75 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |