Forum Discussion
Show Zero in table
- 1 year ago
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
- DuncanYeah1 year ago
Helper 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
- Ritaf19831 year ago
Super 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
- DuncanYeah1 year ago
Helper III
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