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.
Table
Stock | |||
Products | 01-01-2023 | 07-01-2023 | 14-01-2023 |
A1 | 100 | 90 | 110 |
A2 | 80 | 120 | 100 |
A3 | 20 | 40 | 10 |
A4 | 50 | 30 | 70 |
Required output - i need only change in the stock numbers Can any one help me with the dax
Products | 01-01-2023 | 07-01-2023 | 14-01-2023 |
A1 | 0 | -10 | 20 |
A2 | 0 | 40 | -20 |
A3 | 0 | 20 | -30 |
A4 | 0 | -20 | 40 |
The dates need to be on rows, if not then unpivot.
Refer this for unpivoting:
Then join the date with Date in Date table and create date table if needed.
Then create a measure like one below and use it with date of week start form Date Table
Diff =
Var _Max = calculate(max(Table[Date]), filter(all(Date), Date[Date] < max(date[Date])))
return
sum(Table[Value]) - calculate(max(Table[Date]), filter(all(Date), Date[Date] =_max))
Refer for more information:
ower BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |