Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Column and line chart - filter every one seperately

Hey Power Bi Guys!

I have my data like this:

 

MonthProfitactual/planned
15000planned
23000planned
34000planned
42000planned
12000actual
24000actual
33000actual
49000actual

 

no I want to make a column and line chart (x-axis is month, y axis profit) and the colums show the actual values while the line shows the planned value.

is there a way to do this easily? If I set a filter on "actual", it affects the whole visual, can I just filter the line/columns?

Thanks guys!  🙂

 

Cheers,

 

Janik

  • Anonymous , Did not get completely

    But this should work as measure

    planned=calculate(sum(table[profit]), table[actual/planned]="planned")
    actual=calculate(sum(table[profit]), table[actual/planned]="actual")

     

    and these a new columns

    planned=if( table[actual/planned]="planned",table[profit], blank())
    actual= if( table[actual/planned]="actual",table[profit], blank())

  • Create 2 measures:

     

    Measure 1 = SUMX(FILTER('Table',[actual/planned] = "planned"),[Profit])

    Measure 2 = SUMX(FILTER('Table',[actual/planned] = "actual"),[Profit])

4 Replies

  • Anonymous , Did not get completely

    But this should work as measure

    planned=calculate(sum(table[profit]), table[actual/planned]="planned")
    actual=calculate(sum(table[profit]), table[actual/planned]="actual")

     

    and these a new columns

    planned=if( table[actual/planned]="planned",table[profit], blank())
    actual= if( table[actual/planned]="actual",table[profit], blank())

  • VijayP's avatar
    VijayP
    Icon for Community Champion rankCommunity Champion

    is the data in same table or two different Tables? If you Keep this in single table you can do much Easy!

    • Anonymous's avatar
      Anonymous
      Not applicable

      VijayPit's in a single table.

      Much easy? Tell me more 🙂

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Create 2 measures:

     

    Measure 1 = SUMX(FILTER('Table',[actual/planned] = "planned"),[Profit])

    Measure 2 = SUMX(FILTER('Table',[actual/planned] = "actual"),[Profit])