This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I have a table with the columns date, metric and value.
i would like to know if is possible to pivot the table and and add a column with the diffrerence about only the last two days
in power bi.
The pivot i found the chart that do it.
The problem is to add a column the brings the difference.
table
date metric value
01.01.2024 cash 465464
01.01.2024 amount 45
02.01.2024 cash 34654
02.01.2024 amount 45454
03.01.2024 cash 64564
03.01.2024 amount 12
04.01.2024 cash 64654
04.01.2024 amount 54
chart cash
01.01.2024 02.01.2024 03.01.2024 04.01.2024 %( between 03.01 aand 04.01
465464 34654 64564 74654 30
Solved! Go to Solution.
Hi @paulohummel ,
Here are the steps you can follow:
1. Create calculated table.
Test =
var _table=
SUMMARIZE('Table','Table'[date],"metric","difference",
"value",
SUMX(FILTER(ALL('Table'),'Table'[date]=MAXX(ALL('Table'),'Table'[date])),[value])
-
SUMX(FILTER(ALL('Table'),
'Table'[date]=MAXX(FILTER(ALL('Table'),'Table'[date]<MAXX(ALL('Table'),'Table'[date])),[date])
),[value]))
return
UNION(
'Table',_table)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @paulohummel ,
Here are the steps you can follow:
1. Create calculated table.
Test =
var _table=
SUMMARIZE('Table','Table'[date],"metric","difference",
"value",
SUMX(FILTER(ALL('Table'),'Table'[date]=MAXX(ALL('Table'),'Table'[date])),[value])
-
SUMX(FILTER(ALL('Table'),
'Table'[date]=MAXX(FILTER(ALL('Table'),'Table'[date]<MAXX(ALL('Table'),'Table'[date])),[date])
),[value]))
return
UNION(
'Table',_table)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 7 | |
| 6 | |
| 6 |