Forum Discussion

sotoc's avatar
sotoc
Advocate I
7 years ago

IF then plus Groups in Direct Query

Hi there,

 

Data located here:

https://www.dropbox.com/s/sgsefrujnjkzcai/CarlySoto_data2.csv?dl=0

 

I am using Direct Query and have to do all modeling in the report itself (can't do any steps in Query Editor).

 

I've got customers with two types of sales (date type whole number) in two different fields, plus 2 fields with their descriptors.

 

Individual and HQ -- sales for the single site *this is what I need
Consolidated -- sales for all stores in their corporation *this is what I want to omit

 

Sometimes the Individual site/HQ = corporation so the same sales amount is reported in both fields. Whichever Desc = Individual or HQ, the other is always Consolidated.

 

I want to use only Individual OR HQ sales for each customer (whichever is present):
If Desc0 = Individual or HQ use Num0
If Desc1 = Individual or HQ use Num1

Some customers have blanks

Once this is calculated I want to put the counts into bands into a matrix and/or simple bar/pie charts.

 

 

Thank you!

Carly

4 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi sotoc,

     

    I'm still a little confused about your desired output.

     

    What is Sales Volume?

     

    Do you want to calculate the sales? If it is, what is the logic?

     

    Based on your data sample, I'm not clear which could be calculated as sales. Numx?

     

    Please describe your requirement in more details.

     

     

    Best  Regards,

    Cherry

    • sotoc's avatar
      sotoc
      Advocate I

      Cherry, I figured this out, thank you for the reply.

       

      Carly

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi sotoc

         

        It's glad that you have solved your problem.

         

        If it is convenient, ccould you share your solution or accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

         

        Best Regards,

        Cherry