Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am fairly new to Power Bi and have searched in various online help forums but was unsuccessful in finding the one similar to mine. Hence posting this here. Not sure if this is a fairly straightforward one or complicated (as I think!)
I have 3 columns: 'Event', 'Screen' and 'Time' (Similar to below)
I want do a single calculation as below:
(2*count of "NameSubmitted" occurrences in Event) - (AVG Time of corresponding "NameSubmitted" (from Event) * count of "NameSubmitted" occurrences in Event)
+
(2*count of "AddressAdded" occurrences in Event) - (AVG Time of corresponding "AddAddress" (from screen) * count of "AddressAdded" occurrences in Event)
+
(2*count of "OrderCreated" occurrences in Event) - (AVG Time of corresponding sum of "Orders"+"OrderDetail"+"OrderConfirmation" (from screen) * count of "OrderCreated" occurrences in Event)
My approach:
I have tried to create a new column with the following "IF()" function calculation but in vain (Started like below) and been receiving the following error:
Calc = CALCULATE( (2*SUM(IF(Table[Event] = "NameSubmitted",1,BLANK()))) - AVERAGE(IF(Table[Event] = "NameSubmitted") )) .....
Error: The SUM function only accepts a column reference as an argument.
So, what would be a best way to achieve this calculation?
Any help is much appreciated.
Thanks
Solved! Go to Solution.
HI @MissMintox
Would this calculated column be a good place to start? If it produces the value you need, it should be easy to extend to incorporate the other event types
Column = VAR CountOfNameSubmitted = CALCULATE(COUNTROWS('Table'),ALL('Table'),'Table'[Event]="NameSubmitted") VAR AverageOfNameSubmitted = CALCULATE(AVERAGE('Table'[Time]),ALL('Table'),'Table'[Event]="NameSubmitted") RETURN (2*CountOfNameSubmitted) - (AverageOfNameSubmitted * CountOfNameSubmitted)
HI @MissMintox
Would this calculated column be a good place to start? If it produces the value you need, it should be easy to extend to incorporate the other event types
Column = VAR CountOfNameSubmitted = CALCULATE(COUNTROWS('Table'),ALL('Table'),'Table'[Event]="NameSubmitted") VAR AverageOfNameSubmitted = CALCULATE(AVERAGE('Table'[Time]),ALL('Table'),'Table'[Event]="NameSubmitted") RETURN (2*CountOfNameSubmitted) - (AverageOfNameSubmitted * CountOfNameSubmitted)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |