Forum Discussion

srkase's avatar
srkase
Helper IV
6 years ago
Solved

FILTER AND SUM

hi

 

I have a data like this...

 

MODELQTY
ADB110
ZDB110
ADB110
ADB110
ADB210
CDB11
RAS10
RAS110

 

I want to filter products name starting with "adb" + "cdb"+"zdb" ... and do the sum qty...  Any one can guide?

 

  • Hi,

    In the Query Editor, using Column from Examples, extract the text portion from the alphanumeric string.  Then drag that column to the visual.

  • Hi srkase ,

    did you solve your problem?


    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.

9 Replies

  • Hey srkase ,

     

    this measure

    Measure = 
    CALCULATE(
        SUM('Table'[QTY])
        , FILTER(
            'Table' 
            , LEFT('Table'[MODEL] , 3) IN {"ADB" , "CDB" , "ZDB"})
    ) 

    allows to create something like this:

    Hopefully this provides what you are looking for.

     

    Regards,

    Tom

    • srkase's avatar
      srkase
      Helper IV

      I NEED TO FILTER PRODUCT NAME CONTAINING "XXXXXX" 

    • srkase's avatar
      srkase
      Helper IV

      the product name will have 3 digits or 4 digits or 5 digits... but if we extract left(3) the calculation is not performed.

       

      • TomMartens's avatar
        TomMartens
        Super User

        Hey srkase ,

         

        are there more business rules than the length of the searchstring, that has to be contained in the model name, and that you did not mention yet.

        I assume that Model (derived from the data sample you provided) means Product (what you are using, if you describe why a provided solution will not work).

         

        I will provide a new solution, later this day

         

        Regards,

        Tom

         

        Please consider reading this: https://www.skillsyouneed.com/write/capital-letters.html

  • Hi,

    In the Query Editor, using Column from Examples, extract the text portion from the alphanumeric string.  Then drag that column to the visual.

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi srkase ,

    did you solve your problem?


    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.