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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Slicer after Measure

 

Hi,

I have a Tabell, that look like this

Employee

  1. [Employee ID]
  2. [Start Date]
  3. [End Date] (Blank if still active)
  4. [Contract Type] 

To count, how many Employee I had each month, I create a first a Tabell that contains data  and in the employee-Tabell I crat a measure

Count of Active Employee =

VAR endOfPeriod =MAX ( 'Date'[Date] )

 

VAR startOfPeriod = MIN( 'Date'[Date] )

RETURN

    CALCULATE (

        COUNTROWS ( tabExterne );

        FILTER (

            ALL(tabExterne);

               ( tabExterne[Start] <= endOfPeriod

                         && tabExterne[Ende] >= startOfPeriod)

        )

)

 

Now I want to crat a Matrix, so that I can see how many Employee I had for each Contact-Type, and this is where I need your help.

Because I try to create a Slicer based on the Contract-Typs and this didn’t work, so I hope you can help me.

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

For your scenario, I'm afraid that the cause is the ALL function in your measure.

 

If you use the All function, it returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.

 

You could try this:

 

Count of Active Employee =
VAR endOfPeriod =
    MAX ( 'Date'[Date] )
VAR startOfPeriod =
    MIN ( 'Date'[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( tabExterne );
        FILTER (
            tabExterne;
            ( tabExterne[Start] <= endOfPeriod
                && tabExterne[Ende] >= startOfPeriod )
        )
    )

If you still need help, please share some data sample and your desired output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

This should be doable.  Share a dataset that can be pasted in MS Excel.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

For your scenario, I'm afraid that the cause is the ALL function in your measure.

 

If you use the All function, it returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.

 

You could try this:

 

Count of Active Employee =
VAR endOfPeriod =
    MAX ( 'Date'[Date] )
VAR startOfPeriod =
    MIN ( 'Date'[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( tabExterne );
        FILTER (
            tabExterne;
            ( tabExterne[Start] <= endOfPeriod
                && tabExterne[Ende] >= startOfPeriod )
        )
    )

If you still need help, please share some data sample and your desired output.

 

Best Regards,

Cherry

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

Hi @v-piga-msft,

Thank you, i will check if it working, but after a quick test I would say yes.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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