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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
DaveCor
Helper I
Helper I

USERELATIONSHIP - What am I doing wrong?

I've become stuck using USERELATIONSHIP for the first time and I don't understand where I need to plug this into my Dax formula. 

 

I've watched several videos and read numerous posts and articles but still can't see what I'm doing wrong. I completely understand the concept of USERELATIONSHIP I just can't figure out the usage of it or where I'm going wrong. 

 

Here is my original formula (The inactive relationship is created and an active relationship already exists. )

 

% of Total (AA) =
DIVIDE( [Total AA],
CALCULATE( [Total AA],
ALL( 'tbl_aa'[AA (Cleaned)] ) ),
BLANK() )

 

 

Here are my attempts at plugging USERELATIONSHIP into the above, none of which work. 

 

 

% of Total (AA) =
DIVIDE( [Total AA],
CALCULATE( [Total AA],
ALL( 'tbl_aa'[AA (Cleaned)] ) ), USERELATIONSHIP('Calendar'[Date], tbl_mpl[last_closed_date])
BLANK() )

% of Total (AA) = 
DIVIDE( [Total AA], 
    CALCULATE( [Total AA], 
ALL( 'tbl_aa'[AA (Cleaned)] ) ), 
BLANK() 
USERELATIONSHIP('Calendar'[Date], tbl_mpl[last_closed_date]) )

% of Total (AA) = 
CALCULATE(
        DIVIDE( [Total AA], 
            CALCULATE( [Total AA], 
ALL( 'tbl_aa'[AA (Cleaned)] ) ), USERELATIONSHIP('Calendar'[Date], tbl_mpl[last_closed_date]) 
BLANK() )

 

 

I would appreciate some help with this

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

USERELATIONSHIP is a filter modifier, you need put it into CALCULATE

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

USERELATIONSHIP is a filter modifier, you need put it into CALCULATE

I thought I had in my final attempt above but your comment made me look again and figured it out

 

% of Total (AA) = 
DIVIDE( [Total AA], 
    CALCULATE( [Total AA], 
ALL( 'tbl_aa'[AA (Cleaned)] ), USERELATIONSHIP('Calendar'[Date], tbl_mpl[last_closed_date]) ), 
BLANK() )

 

Now my only problem is its not calculating the % correctly but thats a different issue. Thanks for your help 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors