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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Sharkybu
Helper II
Helper II

Visualization data changes when using count filtering

Hello again to the brilliant minds here.
 This is an example to the table I have (I apologize for the spelling error, i built the file in a hurry)

Sharkybu_0-1739175641679.png

My needed parameters to filter:

Before 2020 - eliminating Project 6 (Done by basic visualization parameter)

Sharkybu_2-1739175773172.png

Must have internal hires- eliminating Project 2 (Done by a mix of DAX columns and visualization filtering)

Sharkybu_10-1739176128144.png

Sharkybu_11-1739176145098.png

Sharkybu_5-1739175875952.png

Project that a certain facility is a part of- chosen by user (Done by creating a new table, DAX column and a measure that is filtered) 

Sharkybu_9-1739176112545.png

Sharkybu_12-1739176176751.png

Sharkybu_13-1739176205075.png

Sharkybu_14-1739176218270.png

 

Result when selecting West

Sharkybu_15-1739176302815.png



And then I need two bar charts
One shows how many projects each internal person has (filtering the result table)

Sharkybu_16-1739176339235.png

One shows amount of project every department from chosen facility has (creating a second facility measure to filter by)

Sharkybu_17-1739176384960.png

Sharkybu_18-1739176395043.png


I'm able to get the results I want but when I try to 'count' the  "id" column, the results change.

Sharkybu_19-1739176419172.png

I can't understand why it's doing that.
Please save me.

(It won't let me attach the actual data file)

Thank you.

 

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

Hi, @Sharkybu 
Thanks for reaching out to the Microsoft fabric community forum.

Regarding the issue you raised, my solution is as follows:

Based on my tests, the issue you are encountering is mainly due to the count aggregation method's calculation process not being directly affected by filters. In other words, when you use the aggregation method on a field, the filters will only determine whether the row values are displayed, but they will not affect the calculation result itself.

 

If you want to get the desired result directly, I recommend using the following measure:

 

 

MEASURE = 
VAR cc1 =
    SELECTEDVALUE ( 'Table 2'[Facility] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[ID] ),
        FILTER (
            'Table',
            'Table'[internal hire] = "Yes"
                && CONTAINSSTRING ( 'Table'[Project facility], cc1 )
        )
    )

 

 

The final result is as follows:

vlinyulumsft_0-1739259598734.png

Please note that my visual object does not have any filters set.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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
v-linyulu-msft
Community Support
Community Support

Hi, @Sharkybu 
Thanks for reaching out to the Microsoft fabric community forum.

Regarding the issue you raised, my solution is as follows:

Based on my tests, the issue you are encountering is mainly due to the count aggregation method's calculation process not being directly affected by filters. In other words, when you use the aggregation method on a field, the filters will only determine whether the row values are displayed, but they will not affect the calculation result itself.

 

If you want to get the desired result directly, I recommend using the following measure:

 

 

MEASURE = 
VAR cc1 =
    SELECTEDVALUE ( 'Table 2'[Facility] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[ID] ),
        FILTER (
            'Table',
            'Table'[internal hire] = "Yes"
                && CONTAINSSTRING ( 'Table'[Project facility], cc1 )
        )
    )

 

 

The final result is as follows:

vlinyulumsft_0-1739259598734.png

Please note that my visual object does not have any filters set.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

Thank you, thank you, thank you!!!

Hi, @Sharkybu 
I am glad that my answer could help you, and I appreciate you accepting my answer as the solution. This recognition of my efforts also helps others in the community with similar issues find solutions more quickly.

 

If you encounter any problems in the future, feel free to share them again.

 

Have a great day!

 

Best Regards,

Leroy Lu

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors