Forum Discussion
TotalYTD Not Adding Correctly
- 3 years ago
This column definition is iffy:
Salary Hours Column = Calculate( ([Active Salaried] * (40/7)) * MAX('Date Table'[Day]) )as it includes a measure. Now in this case the measure itself is a constant, but in general the rule is that you cannot create columns from measures/filters.
Here is a proposal for an alternative, more pedestrian calculation. It uses day level granularity rather than relying on ENDOFMONTH.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- AppleMan3 years agoHelper III
I have edited the post to have a link to a test PBI file that also shows the expected results in an image.
- lbendlin3 years agoSuper User
This column definition is iffy:
Salary Hours Column = Calculate( ([Active Salaried] * (40/7)) * MAX('Date Table'[Day]) )as it includes a measure. Now in this case the measure itself is a constant, but in general the rule is that you cannot create columns from measures/filters.
Here is a proposal for an alternative, more pedestrian calculation. It uses day level granularity rather than relying on ENDOFMONTH.
- AppleMan3 years agoHelper III
Very interesting solution. That measure is actually not a constant in my real report, I made it one in the example to simplify it.
I will mark your answer as the solution. I like the way you wrote the YTD function, I will definitely take note of that for my future reports. Thank you!