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.
Hi!
I've been working on a project and now I need to create a Summary Table. The main Table has a column named "Product" where are the products that each worker has made (comma separated) and the column "Proccess Time" shows the respective time of production.
I need to create a Summary Table, like the Excel image below, that calculates the average proccess time if value on column "Product" contains the string in column "Contains". I have tried to create a Table in PowerBI using the functions "Calculate"+"Filter"+"Related", and even using "Summarize", but it didn't work correctly. Could someone help me to understand how can i make this Summary Table?
PS.: in Excel I have used "Avarageif" function to obtain the Summary Table.
Solved! Go to Solution.
@ACT_
Create a table as follows. Assumed you have a table called 'Contain Table' with Contain text.
ADDCOLUMNS(
'Contain Table',
"Avg",
VAR __Txt = 'Contain Table'[Contains]
VAR __TxtFilter = FILTER( ALLNOBLANKROW( Table03[Product] ) , CONTAINSSTRING( Table03[Product] , __Txt ) )
VAR __Result = CALCULATE( AVERAGE( Table03[Proccess Time] ) , __TxtFilter )
RETURN
__Result
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I started by splitting your data based on the column Product into rows with comma delimiter :
Then I removed the additional spaces :
Then I extracted the product alpha-number like X1, X2...
I created a DAX measure based in the formatted table:
AverageTimeX = CALCULATE(AVERAGE(MyTable[Process Time]), FILTER(MyTable, CONTAINSSTRING(MyTable[ProductName], "X")))
But I fail how you are calculating the average for X, Y and Z
@ACT_
Create a table as follows. Assumed you have a table called 'Contain Table' with Contain text.
ADDCOLUMNS(
'Contain Table',
"Avg",
VAR __Txt = 'Contain Table'[Contains]
VAR __TxtFilter = FILTER( ALLNOBLANKROW( Table03[Product] ) , CONTAINSSTRING( Table03[Product] , __Txt ) )
VAR __Result = CALCULATE( AVERAGE( Table03[Proccess Time] ) , __TxtFilter )
RETURN
__Result
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
106 | |
104 | |
79 | |
68 | |
61 |
User | Count |
---|---|
144 | |
104 | |
103 | |
82 | |
70 |