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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
unarsezer
Frequent Visitor

Filter With Another Measure

I want the user to select a special id with one slicer input. I have a table. This table has different columns including special_ids. One of these columns is the "league" column. I request that I use the league column of the special_id selected by the user as a filter for another measurement.

 

For example, the user has selected Leo Messi from the slicer input. In the table with Leo Messi, the league column says USA1. I want to use this "USA1" value as a filter for another metric.

 

Selected League = SELECTEDVALUE(final_biograpy_data[special_id])
 
When I add the above measurement to a Card image, I get the result I want. Whoever the user selects, the league of the selected special_id appears on the card. But...
 
row_number = CALCULATE(
    COUNTROWS(deneme),
    FILTER(
        ALLEXCEPT(deneme, deneme[attacking_labels]),
        deneme[league] = [Selected League] && deneme[template_position] = "CF"
    )
)
 
When I run the above measure, unfortunately, it covers all leagues in the dataset. However, the user has selected Leo Messi. His league was USA1. USA1 has a total of 250 special_ids, while the whole dataset has 10000 observations. Why is this filter not working?
 
I'm new to PowerBI. Thank you for your understanding.
 
Note: The common column in two different data sets is the special_id column. 
 
 

 

 

1 ACCEPTED SOLUTION
Manoj_Nair
Solution Supplier
Solution Supplier

@unarsezer- Please check this out and let me know if this work.

row_number = 
VAR SelectedLeague = [Selected League]
RETURN
    CALCULATE(
        COUNTROWS(deneme),
        FILTER(
            ALLEXCEPT(deneme, deneme[attacking_labels]),
            deneme[league] = SelectedLeague && deneme[template_position] = "CF"
        )
    )

I've hypothetically established this DAX measure, but without much clarity regarding your datasets. If this doesn't serve your needs, I recommend you share a sample dataset. This will give me a more comprehensive understanding of your data structure, enabling me to devise a more suitable solution. Cheers

 

View solution in original post

2 REPLIES 2
Manoj_Nair
Solution Supplier
Solution Supplier

@unarsezer- Please check this out and let me know if this work.

row_number = 
VAR SelectedLeague = [Selected League]
RETURN
    CALCULATE(
        COUNTROWS(deneme),
        FILTER(
            ALLEXCEPT(deneme, deneme[attacking_labels]),
            deneme[league] = SelectedLeague && deneme[template_position] = "CF"
        )
    )

I've hypothetically established this DAX measure, but without much clarity regarding your datasets. If this doesn't serve your needs, I recommend you share a sample dataset. This will give me a more comprehensive understanding of your data structure, enabling me to devise a more suitable solution. Cheers

 

It worked like a charm! Thanks a lot! 

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.