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
eamonnde
Frequent Visitor

Count and Sum Slicer error

Hi,

 

I'm having issues getting a slicer to work with other tables and graphs within a report that I've created, all interactions are set up correctly.

 

The interactions and slicer work when the measure calculation for value is set up as a count, but not when this measure is changed to a sum.


**************Count**************
ActiveEmployees = COUNTX( 'Table 1',
CALCULATE( COUNTA('Date'[DateKey]),
FILTER( 'Date',
'Date'[DateKey] >= 'Table 1'[CommencedDateKey] && 'Table 1'[DateKey] <= 'Table 1'[EndedDateKey]) ) )

 

***************SUM***************
ActiveEmployees = SUMX( 'Table 1',
CALCULATE( VALUES('Table 1'[ABC]),
FILTER( 'Date',
'Date'[DateKey] >= 'Table 1'[CommencedDateKey] && 'Date'[DateKey] <= 'Table 1'[EndedDateKey]) ) )

 

There is also no relationship between the date table and the main table.

 

Can someone please provide some support with this?

 

Thanks

1 ACCEPTED SOLUTION

Thanks @v-ljerr-msft,

 

Sorry for the slow response, this gave me something close to what i was looking for. I managed to solve the issues using the below equation. 

 

Thanks again.

 

ActiveFTE:= SUMX( 'Table 1', 'Table 1'[FTE] * IF( 

        CALCULATE( COUNTA( 'Date'[DateKey]), 

                   FILTER( 'Date',  

                           'Date'[DateKey] >= 'Table 1'[CommencedDateKey] && 'Date'[DateKey] <= 'Table 1'[EndedDateKey]) )  > 0 , 1 , 0))

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @eamonnde,

 

Could you try using the formula below to see if it works? Smiley Happy

ActiveEmployees =
SUMX (
    'Date',
    CALCULATE (
        SUM ( 'Table 1'[ABC] ),
        FILTER (
            'Table 1',
            'Date'[DateKey] >= 'Table 1'[CommencedDateKey]
                && 'Date'[DateKey] <= 'Table 1'[EndedDateKey]
        )
    )
)

 

Regards

Thanks @v-ljerr-msft,

 

Sorry for the slow response, this gave me something close to what i was looking for. I managed to solve the issues using the below equation. 

 

Thanks again.

 

ActiveFTE:= SUMX( 'Table 1', 'Table 1'[FTE] * IF( 

        CALCULATE( COUNTA( 'Date'[DateKey]), 

                   FILTER( 'Date',  

                           'Date'[DateKey] >= 'Table 1'[CommencedDateKey] && 'Date'[DateKey] <= 'Table 1'[EndedDateKey]) )  > 0 , 1 , 0))

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.