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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
amitnarkar3
Helper I
Helper I

TOTALYTD with DirectQuery

Hi All,

 

Could you suggest an aquivalent for TOTALYTD() function in DirectQuery mode?

This should work with Date Slicer selection.

 

Thanks,

Amit

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@amitnarkar3

 

You can try to click "File"->"Options and settings"->"Options"->"DirectQuery"->check "allow unstricted measures" to enable TOTALYTD.

 

Do mind the that using the unstricted measures would affect performance in DirectQuery mode.

View solution in original post

6 REPLIES 6
mattbrice
Solution Sage
Solution Sage

CALCULATE (
    SUM ( Table[Column] ),
    FILTER (
        ALL ( Calendar ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            && YEAR ( 'Calendar'[Date] ) = YEAR ( MAX ( 'Calendar'[Date] ) )
    )
)

this also works only when I enable unrestricted option in power bi desktop. will it still work on power bi portal or azure portal?

Do we need to enable same thing in that case and from where I can do it?

@amitnarkar3

You just publish and don't have to change anything in Power BI Service.

Eric_Zhang
Microsoft Employee
Microsoft Employee

@amitnarkar3

 

You can try to click "File"->"Options and settings"->"Options"->"DirectQuery"->check "allow unstricted measures" to enable TOTALYTD.

 

Do mind the that using the unstricted measures would affect performance in DirectQuery mode.

thanks I could use it after the option is enabled.

@Eric_Zhang

 

I need to publish this on Azure portal, will it still work. Do I need to also enable this option anywhere else?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors