Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Rabi
Resolver I
Resolver I

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. 

FEFEF.png

 

Please can someone help me with this

Thanks verymuch !!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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)

vyiruanmsft_0-1716365944506.png

Best Regards

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Mahesh0016  Thanks for your contribution on this thread.

Hi @Rabi ,

I created a sample pbix file(see the attachment) base on your provided sample data and measures, it can return the expected result. How did you set your matrix visual? Is something missing here?

vyiruanmsft_1-1716276729853.png

Best Regards

@Anonymous  can you please have a look at this thread https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-DAX-measure-gives-different-Result-PBIX-attached/m-p/3931900#M152980 i have attached a sample PBIX with the result i want to achieve.

 

Thank you !!

Anonymous
Not applicable

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)

vyiruanmsft_0-1716365944506.png

Best Regards

Hi @Anonymous , I appreciate your help, But I need to have only negative values in the matrix as I have thousands of employee data to show.

 

Thanks !!

Mahesh0016
Super User
Super User

Hello @Rabi,

Could you please share the expected output? This will help us better understand the problem.

@Mahesh0016   can you please have a look at this thread https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-DAX-measure-gives-different-Res... i have attached a sample PBIX with the result I want to achieve

 

Thank you !!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.