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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mussaka
Helper I
Helper I

Matrix not updating based on filters

I created a table where each employee has a row that corresponds to the first fortnight of each month: January 15th, January 30th and so on until the end of the calendar year. For each row (and therefore for each period) there is a column with the hours of OT (OT>0). I created a multiple selection filter in power bi that gives the possibility to choose any fifteen.

Mussaka_1-1679303336002.png

 

I created a matrix where each employee has a row and a column where the OT hours of each period are added up. I created a matrix in which the following grouped employees are present in the rows: who did during the year from 32.01 to 60 hours of OT; from 61 to 87 hours and over 87. In the columns the corresponding headcount of each grouping and the percentage of the headcount on the total number of employees who have done more than 33 hours of OT. If I filter for each period, both the matrix with the grouped hours and the matrix with the total hours of OT must be updated. The measure is the following:

IF(
    [OT > 0] > 87,
    "oltre 87",
    IF(
        AND([OT > 0] > 32.01, [OT > 0] <= 60),
        "33-60",
        IF(
            AND([OT > 0] >= 61, [OT > 0] < 88),
            "61-87",
            BLANK()
        )
  )

If I don't select any period, but leave all the periods, the slicer works, but if I select any period, the table returns incorrect numbers. How can I fix?

 
6 REPLIES 6
v-zhangti
Community Support
Community Support

Hi, @Mussaka 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I need to create a matrix where employees are divided into the following groups in the rows: over 32.01 hours and less than or equal to 60 hours, between 60.01 hours and 87 hours, over 87 hours. In the columns, there should be the number of employees belonging to that group and the corresponding percentage. The problem is grouping the hours for each period. I have created a calculated column: if [#"OT_fact (1) original (2).OT YTD"]>87 then "over 87" else if [#"OT_fact (1) original (2).OT YTD"]>=32.01 and [#"OT_fact (1) original (2).OT YTD"]<=60 then "33-60" else if [#"OT_fact (1) original (2).OT YTD"]>=61 and [#"OT_fact (1) original (2).OT YTD"]<88 then "61-87" else 0, where [#"OT_fact (1) original (2).OT YTD"] is the grouping for ALL periods

Mussaka_1-1679492422314.png

 

However, if I create a simple filter like this

Mussaka_0-1679492359064.png

 

, the matrix does not update, of course, for each period. Here's what I need: I need to figure out how to group the hours by period so that the matrix updates once the filter is selected.

Hi, @Mussaka 

 

Are you expecting the Range calculation column to change dynamically based on the date after the filter selection, which I'm afraid is not possible. If you try to group the times by Measure, the measure can only be placed in the value of the matrix.

vzhangti_0-1679556503542.png

Please refer to the attachment and share your ideas in time.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

But wouldn't it be possible to first group the hours (OT) by "reference period" (just as I had done by grouping them by YTD) through a calculated column, and once this is done, try to insert it into the matrix so that it changes based on the filter?

Mussaka_0-1679559820130.png

 

Hi, @Mussaka 

 

Is this the result you expect?

Range Column = IF([OT]>87,"Other 87",IF([OT]>32&&[OT]<=60,"33-60",IF([OT]>=61&&[OT]<88,"61-87",BLANK())))

vzhangti_0-1679563889350.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

No...I aspect this matrix:

Mussaka_0-1679566271294.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.