This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
Very common topic, but I cannot find an easy and proper solution. I have data coming and I applied some transformations to unpivot the data. As a result, I have 7 columns (the 7 first) that give me details on the order. and all the other columns (up to 90 columns) are the product they ordered (in the headers the name of the product, in the cell the quantity)
I would like to add a column that gives me the total quantity of the products ordered. Obviously dynamically. I found some codes online. This one work but it does not add a column with the quantity rather a table with all my data unpivoted and a sum column...
let
Source = Consolidation,
#"Colonnes supprimées" = Table.RemoveColumns(Source,{"What is your e-mail address ?", "Loyalty Card", "Card Number"}),
#"Espaces supprimés" = Table.TransformColumns(#"Colonnes supprimées",{{"City", Text.Trim, type text}}),
#"Personnalisée ajoutée" = Table.AddColumn(#"Espaces supprimés", "Personnalisé", each
let
FirstColRef = 7,
NumColsToSum = Table.ColumnCount(#"Colonnes supprimées")-FirstColRef,
RowTotal = Table.AddColumn(#"Colonnes supprimées", "Sum", each List.Sum(List.Range(Record.ToList(_),FirstColRef,NumColsToSum)))
in
RowTotal
)
in
#"Personnalisée ajoutée"
Can someone help please ?
Solved! Go to Solution.
This would work
let
Source = Consolidation,
#"Colonnes supprimées" = Table.RemoveColumns(Source,{"What is your e-mail address ?", "Loyalty Card", "Card Number"}),
#"Espaces supprimés" = Table.TransformColumns(#"Colonnes supprimées",{{"City", Text.Trim, type text}}),
FirstColRef = 7,
RowTotal = Table.AddColumn(#"Colonnes supprimées", "Sum", each List.Sum(List.Skip(Record.ToList(_),FirstColRef)))
in
RowTotal
This would work
let
Source = Consolidation,
#"Colonnes supprimées" = Table.RemoveColumns(Source,{"What is your e-mail address ?", "Loyalty Card", "Card Number"}),
#"Espaces supprimés" = Table.TransformColumns(#"Colonnes supprimées",{{"City", Text.Trim, type text}}),
FirstColRef = 7,
RowTotal = Table.AddColumn(#"Colonnes supprimées", "Sum", each List.Sum(List.Skip(Record.ToList(_),FirstColRef)))
in
RowTotal
Check out the May 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.