Forum Discussion

Rabi's avatar
Rabi
Resolver I
2 years ago
Solved

Measure Does Not work Properly.

Full NameContract Hours

Worked Hours

Pay date
ABC

76

7.615/01/2024
ABC767.615/01/2024
ABC761415/01/2024
JOHN42628/01/2024
JOHN422528/01/2024
JOHN42328/01/2024

 

Hi Everyone, 

 

Above is the sample data of the timesheet.

I am getting correct results when i have a single pay date selected but when i add the same measure in matrix and add pay date in the column, i am not getting correct results I am not sure why.

 

1 st measure to calculate Hours Worked

 

Worked Hours= sum('Table A'[Worked Hours])

 

2nd measure to calculate contract hours as Contract hours is done for fortnight

 

Contract Hours = 
    SUMX(
        SUMMARIZE(
            'Table A', 
            'Table A'[Full Name], 
            "CONTRACT", max('Table A'[Contract Hours])
        ), 
        [CONTRACT]
    )

 

 3 rd to calculate difference

 

Difference= [Worked Hours]-[Contract Hours]

 

I am checking the variance of the hours so in the matrix i am doing Difference is less than 0 in the filter. 

 

Please can someone help me with this

Thanks verymuch !!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Rabi ,

    You can create another measure as below and apply a visual-level filter to filter the data which [Difference] is less than 0. Please find the details in the attachment.

    Flag = IF( MINX(ALLSELECTED('SAMPLE'[Pay date]),[Difference]) < 0, 1)

    Best Regards

6 Replies