Forum Discussion
PIVOT Table Alternative with SUMIF?
Hi experts!
I'm trying to recreate Excel reports in Power BI and I am struggling with this one report as it has multiple aggregations.
In the screenshot attached, I've included a snippet of the source data, the table results expected and the additional pivot table that's created from the expected results. Please note, I'm aware that PBI doesn't recoginze the special formattting of (h):mm:ss
Source data has potentially 2 rows for each Master Contact ID with different fields populated and Contact Skill Names.
I need to combine the rows by MasterID, so there is only a single row for each MasterID which includes both Prequeue and Inqueue times (which appear on different rows). I've figured out how to do this in Power Query via Grouping. So now, I have a new table with Unique MasterID's and their combined Prequeue/Inqueue details in a single row, but if I try to add the Contact End Date field to the aggregation in the grouping, I end up with the Dates being duplicated.
I'm struggling with how to use the newly created table (with 1 row for each MasterID) to get a single row for a unique date so I can count the # of Master ID's from that date, plus the other 2 data columns sum/average etc.
I've tried various versions of the Measures that I've found on this forum: CALCULATE(FILTER(SUM and even a SUMMARIZE formula
- Anonymous1 year ago
Hi Anonymous ,
Regarding the error you mentioned, the cause of the error is that the data type of a measure cannot be a table. Measures are typically single numerical values or calculation results, not tables containing multiple rows or columns of data. Since SUMMARIZE returns a table, I recommend creating a calculated table instead of a measure.
CalculatedTable = SUMMARIZE( 'Source Data', 'Source Data'[Contact End Date Time], "Total Prequeue Time", SUM('Source Data'[Prequeue Time]) )Best Regards,
Bof
3 Replies
- lbendlin
Super User
I'm trying to recreate Excel reports in Power BIPlease stop doing that. Power BI is not Excel. Use Power BI for its strengths. If you need that exact format then continue to use Excel.
- AnonymousNot applicable
You are so right, time to rethink my strategy
- AnonymousNot applicable
Hi Anonymous ,
Regarding the error you mentioned, the cause of the error is that the data type of a measure cannot be a table. Measures are typically single numerical values or calculation results, not tables containing multiple rows or columns of data. Since SUMMARIZE returns a table, I recommend creating a calculated table instead of a measure.
CalculatedTable = SUMMARIZE( 'Source Data', 'Source Data'[Contact End Date Time], "Total Prequeue Time", SUM('Source Data'[Prequeue Time]) )Best Regards,
Bof