Forum Discussion
Anonymous
4 years agoNot applicable
How can I create a bar chart that shows the difference between two values according to their dates
Hello! I'm new to PowerBI and can't figure this one out. I have an Excel datasheet with 4 main columns, the first has the product name, the second has the some parameters related to the products, th...
- 4 years ago
Hi Anonymous ,
Give your data screenshot, I would use a formula similar to this:Diff = VAR __PREV = CALCULATE ( SUM ( 'Table'[Measured] ), ALL ( 'Table'[Year] ), 'Table'[Year] = MAX ( 'Table'[Year] ) - 1 ) RETURN SUM ( 'Table'[Measured] ) - __PREV
You can see in the image below that measure above returns the difference between two years (Product A for 2022-- 3.48-.047 = 3.01)
danextian
Super User
4 years agoHi Anonymous ,
Give your data screenshot, I would use a formula similar to this:
Diff =
VAR __PREV =
CALCULATE (
SUM ( 'Table'[Measured] ),
ALL ( 'Table'[Year] ),
'Table'[Year]
= MAX ( 'Table'[Year] ) - 1
)
RETURN
SUM ( 'Table'[Measured] ) - __PREV
You can see in the image below that measure above returns the difference between two years (Product A for 2022-- 3.48-.047 = 3.01)
Anonymous
4 years agoNot applicable
Thank you so much! It worked even better than what I was initially trying to do 😁