Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

comparative measure for calculated column

Good evening Teachers

Again I come to you for help, the following happens: I need to create a calculated column that groups information from computer models,
where if the count of the model is for example equal to or less than 10 units then you put "others", if this condition is not fulfilled then it returns the model of the computer.
In Excel I found it easy to solve with the following syntax:
= IF (COUNT.IF ([Model]; [@ Model]) <= 10; "others"; [@ Model])
but in dax I have not got it
I appreciate any guidance you can give me
  • Hi,

     

    Try this calculated column formula

     

    =if(CALCULATE(COUNTROWS(Table1),FILTER(Table1,[Modelo]=EARLIER([Modelo])))<10,"Others",[Modelo])

    Hope this helps.

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

     

    Please provide the sample data for further analysis.

     

    BTW, you formula seems like to use count function and if statement to check the count of model column, right?

     

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you very much for the answer so diligent, attached screenshots of how the information is, what I want is a column like "ModeloAgrupado", but in dax

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

         

        Why dont you share your file???  Anyways, try this calculated column formula

         

        =IF(COUNTROW(FILTER(Data,Data[Modelo]=EARLIER(Data[Modelo])))<=10,"Otros",[Modelo])

         

        Hope this helps.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Ashish_Mathur

    Anonymous

    Thank you very much for the response so agile, I really do not know how to attach the file by this very place, so attach the link to download the .xls file

    Even I have not managed to apply dax correctly in this type of cases, so what I have to do is to lower in excel and do it in the classic way.
    Any help is appreciated
    ** question: can be obtained with the use of variables "VAR"
    • Anonymous's avatar
      Anonymous
      Not applicable

      HI Anonymous,

       

      You can upload to onedrive or google drive and share the link here.

       

      Regards,

      Xiaoxin Sheng

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Hi,

       

      Try this calculated column formula

       

      =if(CALCULATE(COUNTROWS(Table1),FILTER(Table1,[Modelo]=EARLIER([Modelo])))<10,"Others",[Modelo])

      Hope this helps.