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
Anonymous
Not applicable

Filter on table with measure not working

Hi,

 

I have two tables Tab1 and Tab2 both containing one column of integer from 1 to 20 000.

 

Goal : user select a first value (Whole Number) from Tab1[col1] with a slicer and then I want an other slicer where the user can select only values between 1 and the selected value in Tab1.

 

I tried to get the selected value thanks to SELECTEDVALUE(Tab1), that is working I can display the choice in a table. 

But to filter Tab2 by doing FILTER(Tab2, Tab2[col2]<[selectedvalue]) it creates me a blanck table.

Whereas if I do  FILTER(Tab2, Tab2[col2]<10) it's working I have only values between 1 and 10 for instance of my Tab2.

 

My measure is a wholenumber.

I have no relationship between Tab1 and Tab2.

 

Thanks for your help,

 

Don't hesitate if I'm not clear,

 

Rob

1 ACCEPTED SOLUTION

@Anonymous 
Not sure how you've created the filter but it should be something like:

FilterMeasure =
COUNTROWS ( FILTER ( Tab2, Tab2[col2] < [selectedvalue] ) )

Place it in the filter pane of the 2nd slicer, select "is not blank" the apply the filter.

View solution in original post

8 REPLIES 8
tamerj1
Super User
Super User

Hi @Anonymous 
Double check the data type of both columns and confirm both are of intiger data type not text or general.

Anonymous
Not applicable

Hi @tamerj1,

 

Thanks for you answer,

 

the data type of both columns is "Whole number"

@Anonymous 
Not sure how you've created the filter but it should be something like:

FilterMeasure =
COUNTROWS ( FILTER ( Tab2, Tab2[col2] < [selectedvalue] ) )

Place it in the filter pane of the 2nd slicer, select "is not blank" the apply the filter.

Anonymous
Not applicable

This is not working,

 

When I do it with [selectvalue] I have a blanck table but if I do :

 

FilterMeasure =
COUNTROWS ( FILTER ( Tab2, Tab2[col2] < 8 )

 

with (8 choosed just for the example) it's working.

 

I guess the problem is my measure but I can display it, it has the good type ect

@Anonymous 
I assumed that there is no relationship between the two tables. Right?

Anonymous
Not applicable

No I said it in my first message

 

I tried to make one  Tab1[col1] (1:*) Tab2[col2] but instead of returning a blanck table after filtering I have all Tab2. That's why I didn't keep the relation ship

FreemanZ
Super User
Super User

hi @Anonymous 

could you elabroate how do you implement "to filter Tab2 by doing FILTER(Tab2, Tab2[col2]<[selectedvalue]) "?

Anonymous
Not applicable

Thanks @FreemanZ for your answer,

 

Fisrt I have slicer where user can choose a Whole Number from 1 to 20 000 from Tab1[col1].

Then I have measure, let's note it measure1, such that measure1=SELECTEDVALUE(Tab1[col1]).

After that I create a table : table2=filter(Tab2, Tab2(col2)<[measure1]). 

And table2 is a blanck table with this method.

 

I can precise more if needed. 

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.

Top Solution Authors