cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
gooranga1
Power Participant
Power Participant

Using format to convert decimal to HH:mm:ss really slow

I have a dax query from an SSAS cube. This takes an average of the time of day from a time dimension. I have tried a couple of measures but I am getting terrible performance trying to convert the average which is a decimal number to HH:mm:ss using format? I have this query below for an SSRS report. the Measures in the cube are decimal for average time of day 0 to 1. The query returns in under a second but if I add the bottom 2 measures that format the time as HH:mm:ss it never finishes? Is this a limitation of dax? I can create the time format in SSRS but I thought I could do this in dax.

 

 

 

 

 

DEFINE
 VAR _Company=3222
 VAR _StartDate = date( 2022, 08, 20 )
 VAR _EndDate = date(2022,09,01)


EVALUATE
SUMMARIZECOLUMNS (
    Engineers[Person Id],
    Engineers[Engineer],
    Engineers[Group Id],
    Engineers[Group Description],
    'Time'[AM PM],
    'Date'[Start Date of Week],
    'Date'[Week of Year],
    'Date'[Month Start Date],
    'Door Event Type'[Door Event Type Description],
    'Door Oversize'[OverSizeDescription],
    FILTER (
        ALL ( Exchanges[DC Id] ),
        CONTAINSROW (
            { 65, 66, 95, 97, 93, 92, 94, 85, 89, 91, 191, 321, 90, 96 },
            Exchanges[DC Id]
        )
    ),
    FILTER ( ALL ( Company[Company Id] ), Company[Company Id] = _Company ),
    FILTER (
        ALL ( 'Date'[Date] ),
        'Date'[Date] >= _StartDate// DATE ( 2022, 08, 01 )
            && 'Date'[Date] < _EndDate // DATE ( 2022, 09, 01 )
    ),
    "Average Dwell Time", [Average Dwell Time],
    "Door Events", [Door Events],
    "Earliest Event",  [Earliest Event],
    "Latest Event",[Latest Event],
    "Earliest Event format", format( [Earliest Event],,"HH:mm:ss")
    "Latest Event format",format([Latest Event],"HH:mm:ss")
    
)

 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@gooranga1 See if this helps: Chelsie Eiden's Duration - Microsoft Power BI Community


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
gooranga1
Power Participant
Power Participant

@Greg_Deckler  perfect! Thank you and @konstantinos !

Greg_Deckler
Super User
Super User

@gooranga1 See if this helps: Chelsie Eiden's Duration - Microsoft Power BI Community


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors