Reputation: 778
I have a table that I want to pull percentage of total information from. The table has 5 columns (Date, User, LoadNbr, Approval and Week)
Date User Id Load Number approval
4/1/2018 ABC123 111A Auto
4/1/2018 ABC123 123A Manual
4/1/2018 DEF456 234A Auto
4/1/2018 ABC123 122B Manual
4/1/2018 DEF456 756F Manual
4/1/2018 ABC123 855F Auto
4/2/2018 DEF456 684D Auto
4/2/2018 ABC123 989S Manual
4/2/2018 ABC123 203T Manual
4/2/2018 ABC123 300Y Manual
4/2/2018 DEF456 989Q Auto
4/3/2018 IJK899 456A Auto
4/3/2018 IJK899 632J Manual
4/3/2018 IJK899 258G Auto
I am trying to have a summary table that will populate each time up connect to a new source that would show something like the following;
Date Auto Manual Total Auto%
4/1/2018 3 3 6 50.00%
4/2/2018 2 3 5 40.00%
4/3/2018 2 1 3 66.67%
I know this is a remedial question and apologize for my limited abilities. any help is much appreciated.
Upvotes: 0
Views: 74
Reputation: 40204
You can do this in DAX using SUMMARIZECOLUMNS
and ADDCOLUMNS
to create a new summary table:
Summary =
ADDCOLUMNS(
SUMMARIZECOLUMNS(Table2[Date],
"Auto", CALCULATE(COUNTROWS(Table2), Table2[Approval] = "Auto"),
"Manual", CALCULATE(COUNTROWS(Table2), Table2[Approval] = "Manual")),
"Total", [Auto] + [Manual],
"Auto%", DIVIDE([Auto], [Auto] + [Manual]))
You can also do it in the query editor:
User Id
column.approval
column. (Select that column and do Transform > Pivot Column using Load Number
as the Values Column.)Total
. (Add Column > Custom Column and use = [Auto] + [Manual]
for the formula.)Auto%
. (= [Auto] / [Total]
)Upvotes: 1