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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi Community,
I want to calculate data in Power Query like Excel example. I tried many ways but failed.
Value,
Formular,
Thank you.
Solved! Go to Solution.
try this:
// output
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
acc = List.Accumulate(
Source[Column1],
{null, {}},
(s,c)=>let n=s{0}??List.Sum(Source[Column1])
in {n*2.32+c-n, s{1}&{{c, n, n*2.32, n*2.32+c, n*2.32+c-n}}}
),
result = Table.TransformColumns(#table(null, acc{1}), {}, each Number.Round(_, 2))
in
result
try this:
// output
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
acc = List.Accumulate(
Source[Column1],
{null, {}},
(s,c)=>let n=s{0}??List.Sum(Source[Column1])
in {n*2.32+c-n, s{1}&{{c, n, n*2.32, n*2.32+c, n*2.32+c-n}}}
),
result = Table.TransformColumns(#table(null, acc{1}), {}, each Number.Round(_, 2))
in
result
Thank you.
Hi, thank you for the help me.
I try add column number for calculate.
But the data is retrieved only for the first column.
Calculate like this
Thank you.
I want to add group in data like this,
How to edit code?
Thank you.
Thank you very much.
Thank you!
But i put same code in Power Query for Power BI, Not work.
your column1 is text, it should be number
Thank you, you have my life. 😊
Great, Can you send .pbix file to my email. (namphon.chailungka@gmail.com)
Thank you so much.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 7 | |
| 7 | |
| 6 |