cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Matrix Table Custom Total

Hi Everyone,

 

I've been working with Power BI for a few weeks now and all is going well.  However, I've ran into a perplexing issues with Matrix row/column Totals, Aggregate Types, and Printing.

 

The problem:  I'm using time as hh:mm:ss but can't find a way to aggregate it because Power BI considers it Text type.

 

I have the seconds that the hh:mm:ss were derived from, so I attempted to create a custom Total column, but can't get DAX to allow me to create the column.

 

Please see attached image.  My datasets are Whole Numbers (Peg counts and seconds) and Text (seconds to hh:mm:ss).

 

Any help would be greatly appreciated.

 

Thanks,Matrix_Issue.jpg

Chas

 

 

4 REPLIES 4
Super User IV
Super User IV

Here is an article and a quick measure that might help:

 

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/td-p/342279

 

Hmmm, you also may need this:

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Smoupre,

 

I checked each link.  The first link will convert sec to hh:mm:ss and that's fine but I already have secs converted to hh:mm:ss.  I'll use this DAX at the BI Desktop level.

 

The second link is a good representation of the first link.

 

The third link, dealing with measures, is along the lines of what I'm in need of.  

 

I need to aggregate "hh:mm:ss" -- I fear that the only way to do this is remove the Total column that's part of the Matrix Table Field well and replace it with a custom DAX function that itterates over all my "hh:mm:ss" row data and aggregates to results.  This is what I need help with <-- creating this custom field for Totals.

 

Thanks,

Chas

I guest I'm looking for something like this in DAX?

 

DAX: Get Filter that's in place,
DAX: SUM(agent_interval[ACD Time])
DAX: Loop over all rows

 

Save that is a Custom Total column..

 

Chas

I guess what I was thinking was to create measure along the lines of the third link. If you are in a row or column, just display the value. If not, then use the second link to convert your duration format to seconds, aggregate and then use the first link to convert back to duration. Sample data would help me get more specific.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors