Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

IF-based columns on a visual...

Hello lovely people.

 

I'm unsure where to start with this requirement, I do hope you can help. I am putting together the following visual

 

 

and I'd like a dynamically changing "Rate per hour" field. Currently, the "Quoted hours" and "Quoted price" come from columns in a table called "Time Entries". The "Rate per hour" comes from a column in a table called "Account Management". Then I have the "Budget" worked out by a measure that multiplies the "Quoted hours" by the "Rate per hour" (32.5 x 65 = 2112.50)

 

This is fine when we have quoted our work to a client in hours, as in the second row in the above screenshot.

 

But when we quote our work as a set value (i.e. the "Quoted Price" of £675.00 in the first row above), I would like for the "Rate per hour" value to be changed to show the result of "Quoted Price" divided by the amount of "Billable Hours" worked, i.e. in this case, we quoted £675, have done 3 hours of work, so 675/3 = 225.

 

"Billable Hours" is a calculated column in a table named "MyMeasures", which only adds up hours if they are marked as billable: 

Billable Hours = CALCULATE(SUM('Time Entries'[TS Total Time Hours Decimal]),'Time Entries'[Billable Binary]=1)
 
Can anyone suggest a method, or point me at some appropriate reading?

3 Replies

  • Hey Anonymous ,

     

    can you please prepare a small pbix that contains some sample data, but still reflects your data model, meaning all the different tables you mentioned and the relationships, upload the pbix to onedrive or dropbox and share the link.

     

    My 1st impression ...

    I would start with a calculated column like so 

    Rate per hour cc = IF(ISBLANK('tablename'[Quoted Price]) , doing this , doing that)

    Regards,

    Tom

    • Anonymous's avatar
      Anonymous
      Not applicable

      I'm sure you'll find that file to be a mess - I am still a noob at all this.

       

      I also should point out that I don't want to overwrite the "Rate per hour" value in the "ITG Account Management", as i'll still need to refer to it when we have not produced a "Quoted Price"