Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Multiple IF Conditions using DAX

Hi there, very new to the BI world and queries in general.  Im sure this is a simple ask. 

 

My data set includes list of employees across multiple product lines.   The User name is repeated throughout the excel because its grouped by week start date.  Each user and week combination has the hours they billed for that week.  The product line they work for has a different billing rate.  

 

However, the billing rate and Revenue however are not columns in my data so i have to calculate it per user and then sum the entire Revenue column.  

 

I just want the sum of all revenue generated for the date range selected. 

 

So, if i were to represent the data graphically, it would be something like this.  Assuming the rate per hour for Jane Inc = $10 and Doe Coe = $20

 

any help appreciated!!

 

WeekUserProduct LineHours WorkedRevenue
1A

Jane Inc

10???
2AJane Inc15??
3AJane Inc5?
1BDoe Co20 
2BDoe Co20 
3BDoe Co10 
1CJane Inc15 
2CJane Inc5 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Could you please help to show the desired table that you want with a screenshot?

     

    So I can try to figure out how to solve it.

     

    Thanks.

    Aiolos Zhao

  • Anonymous , Try like this

    Worked Revenue=
    Switch(true(),
    [Product] = "Jane Inc", 10,
    [Product] = "Doe Coe",20,
    10
    )*[Line Hours]

     

    Better Create a table "Rate"  with Product, Rate . Join on product and try

    Worked Revenue=
    related(Rate[Rate])*[Line Hours]

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi Anonymous ,

     

    Could you please share your sample data and expected result to me if you don't have any Confidential Information? Please upload your files to OneDrive for Business and share the link here.