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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Improving Dax Query Performance

Hi all,

I am looking to improve query performance. The report measures employee activity in a software, showing how many times someone "posted". I have a few lengthy measures in this report which are probably causing the visual on the right to be slow or even overflow. I have tried to clean it up a bit, but it is still pretty slow according to the Performance Analyzer. I would welcome any ideas here! I have attached the .pbix below.

Thanks!

jon_schinker_0-1677600562152.png

- 170/243/8 refer to employee codes


https://drive.google.com/file/d/1pQH4V1aSxYVWnQd-QMcmknrwu_ImbQ_5/view?usp=sharing

3 REPLIES 3
Anonymous
Not applicable

Any ideas here? Would welcome any thoughts!

wdx223_Daniel
Community Champion
Community Champion

it seams more efficient to change the measure of Unproductive Time as this

Unproductive Time2 =
VAR _tbl =
    SUMMARIZE ( 'Audit', Audit[code], Audit[master_key], Audit[trans_date] )
VAR UnproductiveMinutes =
    SUMX (
        _tbl,
        VAR _c = Audit[trans_date]
        VAR _p =
            MAXX ( OFFSET ( -1, _tbl, ORDERBY ( Audit[trans_date] ) ), Audit[trans_date] )
        VAR _min = ( _c - _p ) * 1440
        RETURN
            IF ( _min >= 10 && FORMAT ( _c, "yyyymmdd" ) = FORMAT ( _p, "yyyymmdd" ), _min )
    )
VAR hourNo =
    INT ( MOD ( UnproductiveMinutes, 1440 ) / 60 )
VAR minuteNO =
    MOD ( MOD ( UnproductiveMinutes, 1440 ), 60 )
VAR secondNo =
    INT ( ( UnproductiveMinutes - INT ( UnproductiveMinutes ) ) * 60 )
RETURN
    IF (
        NOT ISBLANK ( UnproductiveMinutes ),
        FORMAT ( hourNo, "#0" ) & ":"
            & FORMAT ( minuteNO, "#00" ) & ":"
            & FORMAT ( secondNo, "#00" )
    )
Anonymous
Not applicable

Thank you for this suggestion! It appears to slightly improve performance. Is there any way around a lengthy waiting process just due to the complexity of the measure? 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.