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

How to display non-existent data

Hello, I want to make the matrix shown below.
However, the data with zero count cannot be displayed.
"Display items without data" or
I couldn't even add 0 to the major formula.
"count = COUNT (table1 [category]) +0"


I want to know this solution.

 

thank you

 

target table

f_999_4-1643256511718.png

 

count = COUNT(table1[category])

f_999_2-1643256411259.png

count = COUNT(table1[category])+0

f_999_3-1643256448831.png

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous So, in your matrix, use the day and id columns from table2. Remove the relationship between the tables and create a measure like:

count = 
  VAR __day = MAX('table2'[day])
  VAR __id = MAX('table2'[id])
  VAR __count = COUNTROWS(FILTER('table1',[id]=__id))
RETURN
  __count + 0

@ 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...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous So, in your matrix, use the day and id columns from table2. Remove the relationship between the tables and create a measure like:

count = 
  VAR __day = MAX('table2'[day])
  VAR __id = MAX('table2'[id])
  VAR __count = COUNTROWS(FILTER('table1',[id]=__id))
RETURN
  __count + 0

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

thank you for your reply.
It's a great solution.
However, in the actual data, the slicer of table1 is applied.
So I want to keep the relation and put the column id of table1.
is it possible?
thank you.

 

HI @Anonymous,

Nope, the filter effect has a high priority than DAX expressions. These expanded parts will be filtered first instead of replace/expand by DAX formulas.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.