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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
bstark1287
Helper II
Helper II

Need to sum year to date by creation date and delivery date

Because there are multiple dates within the table I must use the USERELATIONSHIP dax. Here is what I have: 

 

Total by Create date = CALCULATE([OE],
DATESYTD(
USERELATIONSHIP('Calendar'[Date], Sheet2[CREATE_DATE])))
 
Note: OE= sum of order qty
1 ACCEPTED SOLUTION
PabloDeheza
Solution Sage
Solution Sage

Hi there!

I would be like this:

CALCULATE(
    [OE]
    DATESYTD( 'Calendar'[Date] ),
    USERELATIONSHIP( 'Calendar'[Date], Sheet2[CREATE_DATE] )
)

Let me know if that helps!

View solution in original post

3 REPLIES 3
PabloDeheza
Solution Sage
Solution Sage

Hi there!

I would be like this:

CALCULATE(
    [OE]
    DATESYTD( 'Calendar'[Date] ),
    USERELATIONSHIP( 'Calendar'[Date], Sheet2[CREATE_DATE] )
)

Let me know if that helps!

That did it, thank you! How could I enter USERELATIONSHIP in this DAX? 

CALCULATE(
    SUM('Sheet2'[ORDER_QTY]),
    FILTER(
        ALLSELECTED('Calendar'[Date]),
        ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)
    )
)

Just add it as another argument of your calculate expression, as it will enable the indicated relationship for the duration of the calculation. Should be like this:

CALCULATE (
    SUM ( 'Sheet2'[ORDER_QTY] ),
    FILTER (
        ALLSELECTED ( 'Calendar'[Date] ),
        ISONORAFTER ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), DESC )
    ),
    USERELATIONSHIP ( 'Calendar'[Date], Sheet2[CREATE_DATE] )
)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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