Forum Discussion
Help with DAX
The problem is that I don't see how your visual looks like therefore I assumed that you are interested to show for each employee, the status (late or not late based on the weeks selected (from week or month slicer). In this case I guess there is no need for the weeks to exist in the table visual therefore if the sum is more than zero for any employee within the selected period that means the employee has late hours within that selected period. The simple sum measure should work just fine. If for dome reason you want to keep the week column in the table visual and you want to reflect the status of the selected period over of of the selected weeks the you can use
IF ( CALCULATE ( SUM ( 'Table'[Late_hours] ), ALL ( 'Table'[Week] ) ) =0, "Not Late" ,"Late")
Thanks tried that as a calculated column and it's still at row level.
My visual is a matrix. Column A is "Compliance', Column B is employee name and columns are months/weeks.
If I create calculation as DAX measure I can't show it in Column A. Thanks, hope you can help?
- AndyDD_UK3 years ago
Helper III
Sorry...compliance is whether they are late or not...all the data required is in the one table called EMPL in the Cube...
In EMPL you have week....and in DimDate Table there is week and month
Thanks again
- tamerj13 years ago
Community Champion
AndyDD_UK
The compliance column must not be in the matrix as calculated columns are not dynamic, rather they're calculated once when you refresh the pbix file.
The very first DAX I shared with you is a measure not a calculated column. And I'm pretty sure that once placed in the values of the matrix, it should work just fine at both week level and month level.Compliance Mesure = IF ( SUM ( 'EMPL'[Late_hours] ) = 0, "Not Late", "Late" )