Forum Discussion

Sam_2020's avatar
Sam_2020
Helper I
6 years ago
Solved

Measure

How to write measure of the column header with Sales > 60 and the total value is 100?

 

ProductSalesSales > 60
A100100
B30 
C50 
Total180100
  • Sam_2020 

    for the second scenario,

    please try this

    Measure = 
    VAR _value=SELECTEDVALUE('Table'[SALES])
    return IF(_value>100,_value,SUMX(FILTER('Table','Table'[SALES]>60),'Table'[SALES]))

11 Replies

  • nandic's avatar
    nandic
    Resident Rockstar

    Hi Sam_2020  ,
    If purpose is to display only max value and to display same value in total, below is formula:

    Max Value = IF(MAX(Sheet1[Sales]) = CALCULATE(MAX(Sheet1[Sales]),ALL(Sheet1[Product])),MAX(Sheet1[Sales]))
     


    Cheers,
    Nemanja
    • kkanda's avatar
      kkanda
      Resolver II

      Hello Nemanja,  thanks for the response. I am not looking for the MAX value. What I am looking for is creation of a measure by the simple clicking on any bar - that becomes my selected category. If I get that category name as a new measure, I want to create another chart detailing the sales trend of that category over a period of time. Maybe this is wishful thinking - the experts can give their opinion.

      kkanda

      • nandic's avatar
        nandic
        Resident Rockstar

        Hi kkanda ,

        By mistake i tagged you on this question.
        I also now answered on your question 🙂

    • Sam_2020's avatar
      Sam_2020
      Helper I

      Thanks Namaja for your reply.

       

      If I have other product which are >60, then how should i write the measure?

       

      Product SalesSales > 60
      A100100
      B30 
      C50 
      D7575
      E9090
      Total345265
      • ryan_mayu's avatar
        ryan_mayu
        Super User

        Sam_2020 

        for the second scenario,

        please try this

        Measure = 
        VAR _value=SELECTEDVALUE('Table'[SALES])
        return IF(_value>100,_value,SUMX(FILTER('Table','Table'[SALES]>60),'Table'[SALES]))