Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I have the following query table yet (i'm not interested in a Table or Matrix visual):
How can i get a new column with the relative difference of one of the visible day with the previous visible day?
Thanks for your help
Solved! Go to Solution.
Hi @Anonymous
You can use the OFFSET function.
Here is an example:
Test =
VAR SummarizedTable =
SUMMARIZE (
'Table Principale',
[Date Commande],
"Somme Cash-Flow", SUM ( 'Table Principale'[Prix total avec rabais] )
)
VAR AddPrevious =
ADDCOLUMNS (
SummarizedTable,
"Somme Cash-Flow Previous",
-- Guaranteed to be a single row
SELECTCOLUMNS (
OFFSET ( -1, SummarizedTable, ORDERBY ( 'Table Principale'[Date Commande] ) ),
[Somme Cash-Flow]
)
)
RETURN
AddPrevious
I would also recommend changing SUMMARIZE (...) to ADDCOLUMNS ( SUMMARIZE (... ), ... ), but that's a best practice suggestion rather than a necessity here.
Regards
Hi @Anonymous
You can use the OFFSET function.
Here is an example:
Test =
VAR SummarizedTable =
SUMMARIZE (
'Table Principale',
[Date Commande],
"Somme Cash-Flow", SUM ( 'Table Principale'[Prix total avec rabais] )
)
VAR AddPrevious =
ADDCOLUMNS (
SummarizedTable,
"Somme Cash-Flow Previous",
-- Guaranteed to be a single row
SELECTCOLUMNS (
OFFSET ( -1, SummarizedTable, ORDERBY ( 'Table Principale'[Date Commande] ) ),
[Somme Cash-Flow]
)
)
RETURN
AddPrevious
I would also recommend changing SUMMARIZE (...) to ADDCOLUMNS ( SUMMARIZE (... ), ... ), but that's a best practice suggestion rather than a necessity here.
Regards
Thanks a lot! That works like a charm.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |