Forum Discussion
chris_rowley
5 years agoFrequent Visitor
SumIF less than a specified number
Hi all I have a table that contains data pulled from our time recording system. After some manipulation I have these fields: Total_Hours_Per_week Hourly_Rate Max_hours_Per_Month Each staff ...
Anonymous
5 years agoNot applicable
Hi chris_rowley ,
According to my understand, you want to calculate the Hours * Rate based on two different conditions, right?
You could follow these steps:
1.Create a DateTable with Date , Month , Total weekNum per Month columns like this:
2. Create a relationship between two tables based on Month column.
3.Use the following formula:
Result =
VAR _actualHoursTotal =
SUM ( 'Table'[Total_Hours_Per_Week] )
* MAX ( 'DateTable'[Total weekNum per Month] )
RETURN
IF (
_actualHoursTotal <= MAX ( 'Table'[max_hours_per_month] ),
_actualHoursTotal * MAX ( 'Table'[Hourly_rate] ),
MAX ( 'Table'[max_hours_per_month] ) * MAX ( 'Table'[Hourly_rate] )
)My final visualization looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin