Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi - I have a table in Power BI like so
| Company | Value | Month-Year |
| Head office | 42 | Jan 23 |
| Head office | 53 | Jun 23 |
| Head office | 63 | Dec 23 |
| Factory | 56 | Jan 23 |
| Factory | 65 | Jun 23 |
| Factory | 67 | Dec 23 |
Etc
And I'm looking for DAX that would show the difference from the latest date in the table to the earliest date; so Dec 23 value - Jan 23 value, as a number and a percentage for each company - can anyone help me out with that?
Thanks!
I think you could create a measure like
% diff =
VAR FirstValue =
SELECTCOLUMNS (
INDEX (
1,
'Table',
ORDERBY ( 'Table'[Month-Year], ASC ),
PARTITIONBY ( 'Table'[Company] ),
MATCHBY ( 'Table'[Month-Year], 'Table'[Company] )
),
"@value", 'Table'[Value]
)
VAR LastValue =
SELECTCOLUMNS (
INDEX (
1,
'Table',
ORDERBY ( 'Table'[Month-Year], DESC ),
PARTITIONBY ( 'Table'[Company] ),
MATCHBY ( 'Table'[Month-Year], 'Table'[Company] )
),
"@value", 'Table'[Value]
)
VAR Result =
DIVIDE ( LastValue - FirstValue, FirstValue )
RETURN
Result
Hi @daltonrotork measure could be:
Range as measure:
VAR _max_date=MAX(<Your table>[Month-Year])
VAR _min_date=MIN(<Your table>[Month-Year])
RETURN
CALCULATE( SUM( <Your table>[Value]),
_max_date- _min_date)
Did I answer your question? Mark my post as a solution! Kudos Appreciated!
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 8 | |
| 8 |