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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joshua1990
Post Prodigy
Post Prodigy

SUM with multiple Filters and USERELATIONSHIP

I have a simple transactional table that has an inactive relation to our calendar.

Now I would like to get the SUM of a specific column based on two conditions/ filters that also use USERELATIONSHIP.

This is my original function without USERELATIONSHIP:

SUM = 
CALCULATE (
    SUM ( 'Sales'[Quantity] ),
    FILTER (
        'Sales',
        'Sales'[Type] = 4
            && 'Sales'[Quantity] > 1
    )

Adding USERELATIONSHIP is not that simple because it is not working:

SUM = 
CALCULATE (
    SUM ( 'Sales'[Quantity] ),
    FILTER (
        'Sales',
        'Sales'[Type] = 4
            && 'Sales'[Quantity] > 1
    ), USERELATIONSHIP( 'Sales'[Date], 'Calendar'[Date])

 

What should I change here? 

2 REPLIES 2
Anonymous
Not applicable

What error are you getting? If you are using the exact formula which you posted with USERELATIONSHIP(), you have missed a closing parenthesis in the end. Try putting a closing parenthesis in the end and try again.

 

Regards,

Aditya

amitchandak
Super User
Super User

@joshua1990 , It should have worked. Try with this modification

 


SUM =
CALCULATE (CALCULATE (
SUM ( 'Sales'[Quantity] ), USERELATIONSHIP( 'Sales'[Date], 'Calendar'[Date])),
FILTER (
'Sales',
'Sales'[Type] = 4
&& 'Sales'[Quantity] > 1
))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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