Forum Discussion

Anandakash's avatar
Anandakash
Microsoft Employee
4 years ago
Solved

Plotting calculated Measure after Filtering Table

Let say i have a table T with 4 column (a,b,c,d). i create a measure i.e measure = sum(a), filter(T, b =="some value" and c =="some other value"). 
I want to plot measure VS column d (column which doesn't filter the table while calculating measure. I want this plot to be constant but it not coming as constant plot instead this measure is calculated at every different instance  of column d and then plotting it.

Can i have a constant plot???

Thanks,

Akash

  • Hi, Anandakash ;

    Try it.

    Measure = CALCULATE(Sum('Table'[Sales]), FILTER(ALL('Table'), 'Table'[Gender] == "M" && 'Table'[Age] < 6))

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

7 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anandakash ;

    Try it.

    Measure = CALCULATE(Sum('Table'[Sales]), FILTER(ALL('Table'), 'Table'[Gender] == "M" && 'Table'[Age] < 6))

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anandakash's avatar
      Anandakash
      Microsoft Employee

      Thanks, this is what i wanted so i guess plotting x vs y is somehow internally filtering the table containing x. As putting All table as param in the filter condition fixed the issue and returned us the desired output.

  • VijayP's avatar
    VijayP
    Community Champion

    Anandakash Question is incomplete! it is better share some sample data with a snap shot of out come

  • Anandakash's avatar
    Anandakash
    Microsoft Employee

    let My Table =

    SalesAgeGenderCountry
    113MB
    194FC
    153FA
    146FB
    278MC
    122MA

     

    And

    Measure = CALCULATE(Sum('Table'[Sales]), FILTER('Table', 'Table'[Gender] == "M" && 'Table'[Age] < 6))

     


    See the plot between measure and column Country isn't constant and Instead it is calculating the measure for Country Column instances "A", "B", "C" and then plotting it. 
    I want this plot to be constant for "A", "B", "C". Is this Achievable???

     

  • Anandakash's avatar
    Anandakash
    Microsoft Employee

    amitchandak ( i see you as top Kudoed Author)  is this achievable?? Will really appreciate if you can help here

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anandakash ;

    Try it.

    Measure = CALCULATE(Sum('Table'[Sales]), FILTER('Table', 'Table'[Gender] == "M" && 'Table'[Age] < 6))

    I don't quite understand what you mean, it would be better if you could share the results you wish to output.

    The final show:

    Or

     


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anandakash's avatar
      Anandakash
      Microsoft Employee

      I just want value of this measure to be independent( I.e constant plot of Measure Vs Country) of Country since for calculating measure i have not filtered table on the basis of this column(Country)