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.
So no idea where to start with this soltuion.
What matrix I am after:
Week | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
Item | Price | Change | Price | Change | Price | Change | Price | Change |
123456_ | 5 | 5 | 0 | 6 | 1 | 5 | -1 | |
456789_ | 4 | 3 | -1 | 3 | 0 | 4 | 1 |
The input data is from excel with columns for Item, Week, Price. I am wanting to calculate the change in price from one week to the next within PowerBI. Is it possible to create a single column which will accommodate this when added to the matrix, for example:
Week 2 Change = (Week 2 Price) - (Week 1 Price)
Week 3 Change = (Week 3 Price) - (Week 2 Price)
?
Appreciate the help, hopefully someone has a solution!
Solved! Go to Solution.
Hi @JACK__ ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a calculated column.
Change =
IF (
[Week]
= CALCULATE (
MIN ( 'Table'[Week] ),
FILTER ( ALL ( 'Table' ), 'Table'[Item] = EARLIER ( 'Table'[Item] ) )
),
BLANK (),
[Price]
- CALCULATE (
SUM ( 'Table'[Price] ),
FILTER (
'Table',
'Table'[Item] = EARLIER ( 'Table'[Item] )
&& 'Table'[Week]
= EARLIER ( 'Table'[Week] ) - 1
)
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JACK__ ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a calculated column.
Change =
IF (
[Week]
= CALCULATE (
MIN ( 'Table'[Week] ),
FILTER ( ALL ( 'Table' ), 'Table'[Item] = EARLIER ( 'Table'[Item] ) )
),
BLANK (),
[Price]
- CALCULATE (
SUM ( 'Table'[Price] ),
FILTER (
'Table',
'Table'[Item] = EARLIER ( 'Table'[Item] )
&& 'Table'[Week]
= EARLIER ( 'Table'[Week] ) - 1
)
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, this works great
yes, that sounds like it is possible. Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |