Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to add

Hi All

Below expression working fine :-
 
COGS =
SWITCH(TRUE(),
'Table'[GL CODE]<=39999,"COGS",
BLANK()
)
 
May i know how to add one more below condition to above script  :-
'Table'[GL CODE]>=30000

3 Replies

  • Anonymous , Try like

    COGS =
    SWITCH(TRUE(),

    'Table'[GL CODE]>=30000 && 'Table'[GL CODE]<=39999,"COGS",
    BLANK()
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit

       

      I keep getting error on 'TABLE'[GL CODE] :-

       

      A single value for column 'GL CODE' in table 'TABLE' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

       

      https://www.dropbox.com/s/m67614zz5l4lq66/GL_%20TDS%20v0005.pbix?dl=0

       

       

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , Create as column, Not as measure