Forum Discussion
Show Zero in table
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
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
14 Replies
- Ritaf1983Super User
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
- DuncanYeahHelper III
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
- Ritaf1983Super User
Hi DuncanYeah
Try this formula :Sum_income =var tab = SUMMARIZE(I_table,I_table[Project type],"sum_",sum('I_table'[Income]))
returnSUMX(tab,[sum_])If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly