Forum Discussion
SUMIF in Query Editor on Power BI Desktop?
- 9 years ago
Hi jjbates,
You can open Query Editor, use Group By feature:
The backend M formula is below:
= Table.Group(dbo_DimSalesTerritory, {"SalesTerritoryGroup"}, {{"Total", each List.Sum([SalesTerritoryKey]), type number}})
Best Regards,
Qiuyun Yu
For example the sum of all values where Group = "A":
= List.Sum(Table.SelectRows(PreviousStep, each [Group]="A")[Value])
- Anonymous6 years agoNot applicable
Hello Marcel,
I am trying your formula but I cannot get it to work.
I am doing something a little more complicated:= Table.Group(#"Removed Errors", {"order no."}, {{"Adj Gross Value", List.Sum(Table.SelectRows(PreviousStep, each Text.Start([ReferenceID], 3) = "ADJ") [Gross Value]), type number}}
As you can see I want to match using Text.Start but I cannot get it to work. This is my error:
Expression.Error: The name 'PreviousStep' wasn't recognized. Make sure it's spelled correctly.
If you can help thanks in advance.