Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi everyone,
I am trying to get my table to display categories with number count zero.
I had tried to use +0 but after appling page filter, the table showed some categories that not match the page filter condition.
Anyone know anyways to solve this problem.
Thank You.
Best Regards,
Duncan
Solved! Go to Solution.
Hi @Anonymous
Thx for your reply.
I change the code a little bit and it works.
Code:
Sum_income =
var x = SUM(I_table[Income])
var _P_CatList = CALCULATETABLE(VALUES(P_table[P_Cat]),FILTER(I_table,I_table[Project type] IN VALUES(I_table[Project type])))
return
IF(MAX(P_table[P_Cat]) in _P_CatList,x,x+0
)Thank You.
Best Regards,
Duncan
Hi @DuncanYeah
It is highly likely that a manipulation within the DAX formula can be implemented to preserve the filters as well.
To provide further assistance, access to the data and a clear understanding of the desired outcome are necessary.
you please provide some raw data in your tables (exclude sensitive data) with Text (not a screenshot) format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Ritaf1983,
Thx for your reply, I had created a pbix file simulated my situation.
https://drive.google.com/file/d/1Jn17RmjsW1DyiMbeNwsIZ8k9gAw00Fad/view?usp=sharing
And I cannot do the expected result in the desktop so i provide it here:
| P_Cat | Sum_income |
| A | 100 |
| B | 0 |
Thank you.
Best Regards,
Duncan
Hi @DuncanYeah
Try this formula :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Ritaf1983 ,
Thx for your reply and it kinda works.
However, after applying other filters the categories just disappear instead of showing zero.
Thank You.
Regards,
Duncan
Hi @DuncanYeah
You need to create a model + formulas that serve your scenario...
Hi @Ritaf1983 ,
Sorry for missing the filter in the past example.
I recreate the pbix that have a filter inside.
https://drive.google.com/file/d/1Swv7apy3WZ9KXVwVEUdV8SJGhfLtILbo/view?usp=drive_link
Sorry and thank you for your reply and effort.
Regards,
Duncan
Now i don't understand what a desired result is...+
You add a row with a blank value...is this a value that should be 0?
Yes the value should be zero.
The desired result is replace blank value with zero without adding other categories to the table, which is not belong to the project type.
Regards,
Duncan
@DuncanYeah
You can replace the blank value with zero from PQ :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Ritaf1983 ,
Thank you for your reply.
I can do that in my dummy data but in real situation I am not allow to change the data from PQ.
Regards,
Duncan
Hi @DuncanYeah
You can use this DAX :
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Ritaf1983 ,
Thx for reply.
It works if the filter parameters are all in the same table.However, in the real case the filters parameter are from three different table.
Thank you for your afford and patient.
Regards,
Duncan
Hi @DuncanYeah ,
You can try this code to create a measure.
Sum_income =
var x = SUM(I_table[Income])
var _P_CatList = CALCULATETABLE(VALUES(P_table[P_Cat]),FILTER(I_table,I_table[Project type] IN VALUES(I_table[Project type])))
return
IF(MAX(P_table[P_Cat]) in _P_CatList,x+0,x)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Thx for your reply.
I change the code a little bit and it works.
Code:
Sum_income =
var x = SUM(I_table[Income])
var _P_CatList = CALCULATETABLE(VALUES(P_table[P_Cat]),FILTER(I_table,I_table[Project type] IN VALUES(I_table[Project type])))
return
IF(MAX(P_table[P_Cat]) in _P_CatList,x,x+0
)Thank You.
Best Regards,
Duncan
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.