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 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
- DuncanYeah1 year ago
Helper III
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
- Anonymous1 year agoNot applicable
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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- DuncanYeah1 year ago
Helper III
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