Forum Discussion

Fahim78666's avatar
Fahim78666
Regular Visitor
1 year ago

Power bi

I need to know how to calculate the sales category on general customers

For example how many sales completed from the range of $1 to 50 and $50 to $100

Please help me to do this using power bi

 

Thanks 

13 Replies

  • Jpss's avatar
    Jpss
    Resolver II

    Fahim78666 , 
    you need to create a calculated column with the bucket / range that you need to count
    that will help you get a count of rows per range. 

    Please see this file :Fahim78666 _ jpssSol.pbix

    If you find this helpful, Consider marking this as a solution.

  • Fahim78666's avatar
    Fahim78666
    Regular Visitor

    i have 3 tables name 

    Translines, Transheader and transpayment

    how can i use this 3 table to find the stated above

     

    • Jpss's avatar
      Jpss
      Resolver II

      Please share a pbx file with sample dataset and expected outcome 

      • Fahim78666's avatar
        Fahim78666
        Regular Visitor

        I just have a BAK file 

         

        Can you please login through remote Access and check

    • Fahim78666's avatar
      Fahim78666
      Regular Visitor

      Can you please explain me how database relationships works

      how to know on how to create relationship

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Fahim78666 

    Based on your needs, I have created the following table.

     

     

    First of all, you need to categorize the sales of different customers

    category = IF(SELECTEDVALUE('Table'[sales])>=1 && SELECTEDVALUE('Table'[sales])<50,
    "$1 to 50" ,
    IF(SELECTEDVALUE('Table'[sales])>=50 && SELECTEDVALUE('Table'[sales])<=100,
    "$50 to $100",
    BLANK()))

     

    Then count the different sales categories.

    count = 
    VAR _category = [category]
    VAR _count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[category]=_category))
    
    RETURN _count

     

     

     

     

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Fahim78666's avatar
    Fahim78666
    Regular Visitor

    Can you please explain me how database relationships works

    how to know on how to create relationship