Forum Discussion
Making a blank row visible using an explicit condition
This is my data (the relationship is one-to-many):
I try to make all three rows visible while also having a condition on the 'Year' column. This column is set to 'Don't summarize'. It works fine without any condition on this column, but as soon as I create one, I lose the empty row.
I have enabled the option "Show items with no data". I have also tried "is blank" and "is 0" with no success.
This is the desired result:
10 Replies
- ArklurResolver II
Get rid of that "both" direction of the relationship, it's an ugly way of being able to filter your "dim" table through the "fact" table. Then create a measure like this, and you will get the desired result:
CountRowsTable1 = CALCULATE ( COUNTROWS ( Table1 ), CROSSFILTER ( Table2[ID], Table1[ID], BOTH ) )I'm not sure about the "Total", it should be 2 not 3 by your logic.
- Zyg_DContinued Contributor
Arklur wrote:Get rid of that "both" direction of the relationship, it's an ugly way of being able to filter your "dim" table through the "fact" table. Then create a measure like this, and you will get the desired result:
CountRowsTable1 = CALCULATE ( COUNTROWS ( Table1 ), CROSSFILTER ( Table2[ID], Table1[ID], BOTH ) )I'm not sure about the "Total", it should be 2 not 3 by your logic.
Thanks for the answer.
1. So the filter direction generally should go from "dim" table to "fact" table?
2. The total should be 3.
- ArklurResolver II
Yes, the relationship should be "single" and 1:N, 99% of the time at least.
It's hard to give you the exact answer without knowing the specifics (it doesn't make too much sense for me to include a row in the total that is filtered out in the specific rows), but something like this will work:
CountRowsTable1V2 = IF ( ISINSCOPE ( Table2[Year] ), CALCULATE ( COUNTROWS ( Table1 ), CROSSFILTER ( Table2[ID], Table1[ID], BOTH ) ), COUNTROWS ( Table1 ) )
- az38Community Champion
- Zyg_DContinued Contributor
- FarhanAhmedCommunity Champion
Drag ID from Table 1
Drag Count of ID from Table2
Drag Year from Table2
At ID right click and enable show items with no data
- Zyg_DContinued Contributor
FarhanAhmed wrote:Drag ID from Table 1
Drag Count of ID from Table2
Drag Year from Table2
At ID right click and enable show items with no data
Thank you for the reply. I have followed these steps, but no success. Maybe it is because my relationship is 1:N, not 1:1, which I have mentioned in the question.
- FarhanAhmedCommunity Champion
- Anand24Super User
Hi Zyg_D ,
You will need to change the relationship between the tables to one-to-one and this will be achieved.
This won't be achievable with any other relationship(1-n, n-1, n-n) since Power BI will be unable to recognize blank/NULL.
Refer Below Image:
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!