Forum Discussion

ephramz's avatar
ephramz
Helper II
4 years ago
Solved

Help with project

I have a measure that calculates Arising*Delta, which results blank if no data.

I want to create a new column in Table 2 called Status such if the measure Arising*Delta is a positive value , returns positive, if is negative return negative, if is blank, returns blanks and if result is zero return zero.

 

Regards,

ephramz

  • ephramz That's because you have some other measure that is returning a value so the row is going to get displayed. If you don't want that to happen you can basically take the same exact formula in a new measure that returns 1 or 0. So:

     

    Selector = 
      VAR __WhatToShow = SELECTEDVALUE('Table31a'[Column])
      VAR __Value = MAX([Arising]) * MAX([Delta])
    RETURN
      SWITCH(__WhatToShow,
        "positive",IF(__Value>0,1,0),
        "negative",IF(__Value<0,1,0),
        "zero",IF(__Value=0,1,0),
        1
      )

     

    You use the Filter pane to filter on this measure is 1. This is called a Complex Selector. The Complex Selector - Microsoft Power BI Community

     

    I feel like I've solved 12 problems in one thread.

     

15 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ephramz Try:

    Column = 
      VAR __Package = 'Table2'[Package]
      VAR __Arising = MAXX(FILTER('Table1',[Package] = __Package),[Arising])
      VAR __Delta = MAXX(FILTER('Table1',[Package] = __Package),[Delta])
    RETURN
      IF(__Arising*__Delta <= 0,"Negative","Positive")
    • ephramz's avatar
      ephramz
      Helper II

      Hi is there another way to do it, because my powerbi report keep says "not enough memory" is there another way to optimize this ?

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        ephramz Maybe:

        Column = 
          VAR __Package = 'Table2'[Package]
          VAR __Arising = RELATED('Table1'[Arising])
          VAR __Delta = RELATED('Table1'[Delta])
        RETURN
          IF(__Arising*__Delta <= 0,"Negative","Positive")