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 table but still show data for the column?

Hi,

Essentially I'm trying to filter the table to exclude data for a specific id, but still want to see that one of the rows has no data for the leftover id.

 

For that to make sense, let me illustrate:

 

This is the data:

201810161703.png

This is the table:

201810161704.png

 

As you can see there's no row with name "Test", which makes sense because there's no data for that for the remaining data after filtering.

Ideally, it would be great to still have "Test" next to "Hello" and "World" but to show either 0, or Null, or something along those lines.

 

I've attempted to create a new table:

201810161707.png

This one just has a list of all the possible "name"'s.

And what I did with this is created a relationship:

201810161708.png

 

And in my Power BI table, instead of using "name" from table vals I replace it with "name" from table types.

But, frustratingly, it is still showing the same result as previously! 😐

 

I feel like this is a very simple problem, but for some reason cannot get my head around it!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

You could create the calculated table with the formula below.

 

table = VALUES(Table2[name])

Then create the relationship and create the measure.

 

Measure = var a= CALCULATE(SUM('Table2'[value]),FILTER('Table2','Table2'[some_id]=SELECTEDVALUE(Table2[some_id]))) return IF(ISBLANK(a),0,a)

Here is your desired output.

 

Untitled.png

 

More details, you could refer to the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

You could create the calculated table with the formula below.

 

table = VALUES(Table2[name])

Then create the relationship and create the measure.

 

Measure = var a= CALCULATE(SUM('Table2'[value]),FILTER('Table2','Table2'[some_id]=SELECTEDVALUE(Table2[some_id]))) return IF(ISBLANK(a),0,a)

Here is your desired output.

 

Untitled.png

 

More details, you could refer to the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Did you click the drop down on "name" in the Values area and select "Show items with no data"?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.