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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Kalaivani
Helper III
Helper III

Measure not giving filtered values after removing a dimension

@PowerBl @powerbi2 

Hi,

I have a problem in ffiltering measure in Power BI. Can anyone help me with this? Thanks in advance!!!

Here is the case:

I have 2 measures that calculates count of the selected Providers from 2 different slicers which gives '1' for the selected providers. Here is the measure -

CountProviderCategory =
VAR selectedproviders = CALCULATETABLE(VALUES('Provider Attributes'[ProviderName]))
RETURN
CALCULATE
(
    COUNTROWS('BarChart'),
    FILTER(
        'BarChart',
        'BarChart'[category] = "Provider" && 'BarChart'[ProviderName] IN selectedProviders
    ),
    TREATAS(VALUES('Provider Attributes'[ProviderName]), 'BarChart'[ProviderName])
)
CountComparisonCategory =
VAR selectedproviders = CALCULATETABLE(VALUES('UnionTable'[Value]))
RETURN
CALCULATE
(
    COUNTROWS('BarChart'),
    FILTER(
        'BarChart',
        'BarChart'[category] = "Comparison" && 'BarChart'[ProviderName] IN selectedProviders
    ),
    TREATAS(VALUES('UnionTable'[Value]), 'BarChart'[ProviderName])
)
CombineData =
IF(
    ([CountComparisonCategory] > 0
    ||
    [CountProviderCategory] > 0),
    "0",
    "1"
)

So I added a table visual like below and filtered the table for the CombineData= 0. My issue is when I remove the diemension from the table, the Visits sum is showing the sum of all dimension values instead of sum of values for the filtered countprovidercategory. 

 

In te table below, the total visits value is 158.  But when I remove the dimension from the table, the sum is the sum of all dimension values which is not right. I want 158 only to be shown there even after removing the Dimension from the table visual. 

 

Table Visual while adding Dimension to the table and after removing it from the table:

categoryCountProviderCategoryCountComparisonCategorySum of TotalVisitsDimension
Comparison 189Val1
Provider1 28Val2
Provider1 26Val3
Provider1 15Val4
Provider1 11Val5
categoryCountProviderCategoryCountComparisonCategorySum of TotalVisits
Comparison 1106761
Provider4 35587
1 REPLY 1
tharunkumarRTK
Super User
Super User

Please provide the pbix file with sample data.

 



Need Power BI consultation, hire me on UpWork .


If the post helps please give a thumbs up



If it solves your issue, please accept it as the solution to help the other members find it more quickly.




Tharun



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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