Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Chas2002
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
Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.