Forum Discussion

Oros's avatar
Oros
Post Prodigy
3 years ago
Solved

If statements

Hello.

 

Does this issue need a conditional measure? Any idea is highly appreciated.  Thanks.

 

I have the following product table and customer table.

 

For some reasons, the price that appears in the results table is always based on the pricing level (#4)

 

Based on customer XYZ's pricing level (#2), the correct table result should be

 

 

 

 

 

  • Hi Oros ,

    according to the sample table, I am able to get the correct table. 


    Do the same customer have different pricing level?

12 Replies

  • Hello, is there any relationship between the two table? if no, i think linking the pricing level between two table will solve the problem. Or, another way is create a measure 

    CALCULATE(SUM('PRODUCT TABLE'[PRICE]),'CUSTOMER TABLE'[PRICING LEVEL]='PRODUCT TABLE'[PRICING LEVEL])

     

    Hope able to solve the problem.

    • Oros's avatar
      Oros
      Post Prodigy

      Hi Chew_WenJie ,

       

      Thank you for your quick reply.  The customer table is related to product table through PRICING LEVEL.  Somehow, the measure that you suggested cannot find the column 'PRODUCT TABLE' [PRICING LEVEL]).  DOes the PRICING LEVEL have to be a measure and NOT a column?  Thank you again.

       

      • Chew_WenJie's avatar
        Chew_WenJie
        Resolver III

        Yes, it can be a column, you may refer to the dax below.

        Pricing = CALCULATE(SUM('Product Table'[Price]),'Customer Table'[Pricing Level]=EARLIER('Product Table'[Pricing Level]))

         

        Hope this can help you.