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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
BenHoward
Helper I
Helper I

create new table using a measure as a filter

I have two tables Table 1 and Table2 which are unrelated, and by using a measure which I build up from a selection of values from Table1, I want to build a 3rd table which is a subset, ie a filter, of Table2.

 

Here's the measure I create from Table1. (you can ignore the hardcoded result R2 for now)

Selected name = 
VAR R1 = SELECTEDVALUE(Table1[Column1])
VAR R2 = "Rashi"
RETURN
    R1

 

Then I create Table3 from Table2

Table3 = FILTER(Table2, Table2[Name] = Table1[Selected name])

 

This results in Table3 with zero rows.  

 

However, if I change my measure to use the hardcoded result, eg

Selected name = 
VAR R1 = SELECTEDVALUE(Table1[Column1])
VAR R2 = "Rashi"
RETURN
    R2

then Table3 is created with a single row, which is what I want.  

 

How do I go about creating the table using the variable R1 in the measure, what is the difference between returning the values R1 and R2 - I've done some tests and can see no difference.  An example PBI file is attached here.  

 

Thanks in advance.

 

5 REPLIES 5
saksham_jain
Helper I
Helper I

In the first line, you said Table1 & Table2 are unrelated. But still trying to filter the values of Table2 based on Table1.

Can you share sample data for the tables that you have and the output you are expecting?


<Update>

After a few hours work I have managed to create the table I needed using Power Query

</>

 

Alas not, the example I supplied is a much simpler version of the use case where I create a measure based upon a selection from 2 unrelated tables, which then provides the input for the filter which is applied to a third unrelated table.

amitchandak
Super User
Super User

@BenHoward , I doubt you can create a Table using the measure as a filter.

Try using summarizecolumns

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak - the table is created when using the measure as a filter, it contains data when the measure is written as 

SelectedName = 
VAR R1 = "Rishi"
RETURN R1

but not when the measure is written as 

VAR R1 = SELECTEDVALUE(Table1[Column1])
RETURN R1

I'm trying to understand why this would be.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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