Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi PowerBI community!
I've been going round in circles for a couple of days trying to figure this one out so I decided to reach out for some help.
I'm working with some time series data (example below - my real data is a bit more complex) and want to be able to plot the difference between the first and last value for a given day range. However, I want this value to be on a bar chart that is updated depending on a filter that is on the page.
For example for the data below if I am sepecting the range Day 1 > Day 4 then the value would be 5.7-1.5=4.2; if I am selecting the range Day 3 > Day 5 then it would be 3.2-1.7=1.5.
| Day | Value |
| 1 | 1.5 |
| 2 | 2.4 |
| 3 | 1.7 |
| 4 | 5.7 |
| 5 | 3.2 |
| 6 | 4.8 |
| 7 | 5.3 |
| 8 | 6.9 |
I can easily calculate a difference in DAX between each value and the value on Day 0, but this doesn't update with filters etc.
Any help with this would be hugely appreciated!
Solved! Go to Solution.
Hi @wdbirch19
Would something like this help?
zMeasure =
VAR _StartDate = MIN( 'Table1'[Date] )
VAR _EndDate = MAX( 'Table1'[Date] )
VAR _StartVal =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = _StartDate
)
VAR _EndVal =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = _EndDate
)
VAR _Diff = _EndVal - _StartVal
RETURN
_Diff
OR
zMeasure 2 =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = MAX( 'Table1'[Date] )
)
-
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = MIN( 'Table1'[Date] )
)
I hope this helps.
Hi @wdbirch19
Would something like this help?
zMeasure =
VAR _StartDate = MIN( 'Table1'[Date] )
VAR _EndDate = MAX( 'Table1'[Date] )
VAR _StartVal =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = _StartDate
)
VAR _EndVal =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = _EndDate
)
VAR _Diff = _EndVal - _StartVal
RETURN
_Diff
OR
zMeasure 2 =
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = MAX( 'Table1'[Date] )
)
-
CALCULATE(
MAX( 'Table1'[Value] ),
'Table1'[Date] = MIN( 'Table1'[Date] )
)
I hope this helps.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |