Forum Discussion
Multiplying Two Columns from the same table where one is a count of and another is a conditional
I'm new to PowerBI and what I'm trying to do seems like it should be straightforward, but I can't figure it out. I have a table "Sheet1" that contains columns for "Process Owner" and "Control Frequency" amoung others, but these are the two I'm working with. I then created conditional column in the table named "Cycle Count" that has the following conditions "= Table.AddColumn(#"Changed Type1", "Cycle Count", each if [Control Frequency] = "Annual" then 1 else if [Control Frequency] = "Per Occurrence" then 1 else if [Control Frequency] = "Monthly" then 12 else if [Control Frequency] = "Quarterly" then 4 else null)"
In the visualizations I've created a table that has the Process Owner, Control Frequency, Count of Countrol frequency and the Cycle Count.
I then created a quick measure to multiply the Count of Control Frequency and Cycle Count columns.
And I end up with the following results:
I wasn't a math major, but I'm pretty certain that 1*12 <> 1, 10*4<>100 and so on. What am I doing wrong. Any assistance would be greatly appreciated.
Thanks in advance.
3 Replies
- amitchandak
Super User
PowerBINoob24 , Try a new measure like
Sumx(addcolumns(Summarize(Table, Table[Process Owner], Table[Control Frequency]), "_m1", calculate([Count of Countrol frequency]* [Cycle Count]) ), [_m1])
- PowerBINoob24
Resolver I
When I create that measure it tells me it cannot find the name Count of Control Frequency or the Cycle Count
- PowerBINoob24
Resolver I
So I changed to this:Measure = Sumx(addcolumns(Summarize(Sheet1, Sheet1[Process Owner], Sheet1[Control Frequency]), "_m1", calculate(COUNTA('Sheet1'[Control Frequency]) * COUNTA('Sheet1'[Cycle Count]) ), [_m1])And now I get an error saying "Parameter is not the correct type" and it highlights what I bolded above.