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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
syl-ade
Helper I
Helper I

How to show sum when no filter is applied - USERELATIONSHIP function

Hi all, 

 

I am currently working on HR Analysis Dashboard. I have created measures like Starters and Leavers.

Leaver look like this 

 

Leavers = 
CALCULATE( 
[Count of Employees]
, USERELATIONSHIP(
    'Calendar'[Date]
    , hra_datasource[end_date] 
    )
)

 

 

There is a relationship with the calendar so the correct measure is only shown when date filter is applied. So when date filter is not applied it looks like that:

sylade_0-1714465629329.png

I would like to see as default the total for leavers and starters of the company. Is there a way to do that in PowerBI?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @syl-ade ,

You can update the formula of measure [Leavers] as below and check if it can return the expected result...

Leavers =
IF (
    ISFILTERED ( 'Calendar'[Date] ),
    CALCULATE (
        [Count of Employees],
        USERELATIONSHIP ( 'Calendar'[Date], hra_datasource[end_date] )
    ),
    CALCULATE ( [Count of Employees], ALL ( hra_datasource ) )
)

If the above ones can't help you figure out, please provide some raw data in your table 'hra_datasource' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @syl-ade ,

You can update the formula of measure [Leavers] as below and check if it can return the expected result...

Leavers =
IF (
    ISFILTERED ( 'Calendar'[Date] ),
    CALCULATE (
        [Count of Employees],
        USERELATIONSHIP ( 'Calendar'[Date], hra_datasource[end_date] )
    ),
    CALCULATE ( [Count of Employees], ALL ( hra_datasource ) )
)

If the above ones can't help you figure out, please provide some raw data in your table 'hra_datasource' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors