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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kattlees
Post Patron
Post Patron

Get Yearly Salary Ignoring the Slicer

I am trying to get a list of all employees who were employed on a specific date and their total yearly salary.

 

So for example, I want all employees who were employed on 10-14-18 with their whole salary for 2018.

 

The problem I am having is when I select a specific date, the salary changes for just that date and doesn't keep the whole year salary.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @kattlees 

You could get it by use "ALLxxx" functions to create a measure for yearly salary like below:

Measure =
VAR selectedyear =
    YEAR ( MAX ( 'Table'[Date] ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALL ( 'Table'[Date] ), YEAR ( 'Table'[Date] ) = selectedyear )
    )

If you need further help, please share some sample data and your expected output.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @kattlees 

You could get it by use "ALLxxx" functions to create a measure for yearly salary like below:

Measure =
VAR selectedyear =
    YEAR ( MAX ( 'Table'[Date] ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALL ( 'Table'[Date] ), YEAR ( 'Table'[Date] ) = selectedyear )
    )

If you need further help, please share some sample data and your expected output.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JosefPrakljacic
Solution Sage
Solution Sage

I bet you need to use the ALL Function in some way.

 

But without an example its hard to tell what you need to do.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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