Forum Discussion
Nandu_3033
2 years agoRegular Visitor
Remove 0 values
I want to filter out rows where all the selected columns have a value of 0. If even one of the selected columns has a non-zero value, the row should be displayed. also for eg if i just rem...
- 2 years agothis is the answer
Visual_Filter =VAR __SelectedValues =SELECTCOLUMNS (SUMMARIZE ('Values','Values'[Parameter],'Values'[Parameter Fields]),"Parameter", 'Values'[Parameter])VAR NonZeroCheck =IF(SUMX(__SelectedValues,SWITCH([Parameter],"Cost", IF([Cost] <> 0, 1, 0),0 // Default if no match)) > 0, 1, 0)RETURN NonZeroCheck
AhmadBakr
2 years agoHelper IV
Hey Nandu_3033
What about adding a column with an if statement including all your conditional fields:
IF(
[Cost non Zero] + [Discount non-zero] <> 0,
1
)
Do not put a value for the false value of the condition so IF will return blank and it will not show in your report.
You can add in the IF condition as many measures/column names as you wish.
Only one important remark: I am assuming that the condition values cannot evaluate to negative numbers. If this is not the case, you can use the longer form of the condition:
[Cost non Zero] <>0 || [Discount non-zero] <> 0,