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
MyWeeLola
Helper II
Helper II

How can I display 0 count values on a table filtered with values from another table?

Good afternoon

 

I have 2 tables.

TblRef
A
B
C
D

 

and

 

tblmain
A
B
C
D
E
F
G
H
A
B
B
C
C

 

I want to dsiplay a table which filters tblMain to teh values in tblRef, and displays 0 values.

 

In the examples above I want the display table output to look as below.

 

ValueCount
A2
B3
C3
D0

How do I achieve this?

 

I cannot seem to get the filter correct and when I use a measure to count, I tried adding +0 to the end which then gave me the non tblref values.

 

I look forward to hearing from you.

 

Lola

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @MyWeeLola - if a value from tblRef does not exist in tblMain, it still shows a count of 0. but D is present in main table so we are gtting 1 . 

 

Count for tblRef =
VAR refValues = SELECTEDVALUE(Tblref[TblRef])
RETURN
    CALCULATE(
        COUNTROWS(tblMain),
        Tblmain[tblmain] = refValues
    )
 
 

 

 

rajendraongole1_0-1726144775428.png

 

Hope it helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

uzuntasgokberk
Super User
Super User

Hello @MyWeeLola,

Make relationship your table one to many. İf TblRef have unique values.

uzuntasgokberk_0-1726145672743.png

 

After that You use below the dax code and for example my column name is "Text" but ı take the column from dimension table which means unique column table.

uzuntasgokberk_1-1726145736475.png


However, you can't use the masure in slicer. So that I recommend to use the measure as filter pane.

uzuntasgokberk_2-1726145791490.png

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.



View solution in original post

4 REPLIES 4
uzuntasgokberk
Super User
Super User

Hello @MyWeeLola,

Make relationship your table one to many. İf TblRef have unique values.

uzuntasgokberk_0-1726145672743.png

 

After that You use below the dax code and for example my column name is "Text" but ı take the column from dimension table which means unique column table.

uzuntasgokberk_1-1726145736475.png


However, you can't use the masure in slicer. So that I recommend to use the measure as filter pane.

uzuntasgokberk_2-1726145791490.png

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.



@uzuntasgokberk 

 

Thank you for this, if worked perfectly and I am using this solution for the issue.

rajendraongole1
Super User
Super User

Hi @MyWeeLola - if a value from tblRef does not exist in tblMain, it still shows a count of 0. but D is present in main table so we are gtting 1 . 

 

Count for tblRef =
VAR refValues = SELECTEDVALUE(Tblref[TblRef])
RETURN
    CALCULATE(
        COUNTROWS(tblMain),
        Tblmain[tblmain] = refValues
    )
 
 

 

 

rajendraongole1_0-1726144775428.png

 

Hope it helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@rajendraongole1 

Thank you for this, it worked as i needed it too, thank you.

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.