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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sagarsahoo_123
Helper IV
Helper IV

Need to summarize the count of users having work time <6hrs from the below matrix table

Hello Team,

Please help on the below query. I need support to find out total number of users having less than 6 hours work time from the below Matrix table.

sagarsahoo_123_0-1667498092511.png

Here in the above picture, i have displayed users month wise Work time Details. and in the last it is having total Average of all months work time and i have highlighted users value wherever it is less than 6 hours. But i need the count of total users having overall Average work time less than  6hours and need to display like below.

SummaryHeadCounts
Total number of users <6hours Work time100

Please guide me using which formula i can achieve this. Appreciate your valuable support.

 

Regards,

Sagar

2 ACCEPTED SOLUTIONS
mangaus1111
Solution Sage
Solution Sage

Hi @sagarsahoo_123 ,

try this measure

Measure = 
COUNTROWS(
FILTER(
ADDCOLUMNS(
  SUMMARIZE(Consolidated_Data,
            Consolidated_Data[Personal ID],
            'Date'[Year],
            'Date'[Month name]
            ),
         "@Hours",CALCULATE(SUMX(Consolidated_Data,Consolidated_Data[WT]))
         ),
     [@Hours] < 6 && [@Hours] > 0
     )
)

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

View solution in original post

Hi @sagarsahoo_123 ,

only for the selected month. If you need the average of the last 12 months then

Measure 2 = 
VAR _MaxDate = MAX('Date'[Date])
RETURN
CALCULATE([Measure],
    FILTER(ALL('Date'),
          'Date'[Date]<= _MaxDate && 'Date'[Date] >_MaxDate - 365
      ) )/ 12

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

View solution in original post

10 REPLIES 10
mangaus1111
Solution Sage
Solution Sage

Hi @sagarsahoo_123 ,

try this measure

Measure = 
COUNTROWS(
FILTER(
ADDCOLUMNS(
  SUMMARIZE(Consolidated_Data,
            Consolidated_Data[Personal ID],
            'Date'[Year],
            'Date'[Month name]
            ),
         "@Hours",CALCULATE(SUMX(Consolidated_Data,Consolidated_Data[WT]))
         ),
     [@Hours] < 6 && [@Hours] > 0
     )
)

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

Hi @sagarsahoo_123 ,

only for the selected month. If you need the average of the last 12 months then

Measure 2 = 
VAR _MaxDate = MAX('Date'[Date])
RETURN
CALCULATE([Measure],
    FILTER(ALL('Date'),
          'Date'[Date]<= _MaxDate && 'Date'[Date] >_MaxDate - 365
      ) )/ 12

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

Hello @mangaus1111 ,

Thanks a lot for your timely support. I was verifiying randomly some data for this, but found the number is mismatched when i am selecting customers in Slicer. 

sagarsahoo_123_0-1668487179630.png

For example in the above image, the Total Average of work time < 6hours is for 5 users but in the Card Display it is showing only 1.

Can you please suggest me if i need to modify anything in the code.

Note:-i am using the same code what you have given to me.....

Here is the code i am using for this:--

Code 1:---

Low_WorkTime_HC =
VAR _MaxDate = MAX('FY_Calendar'[Date])
RETURN
CALCULATE([WorkTime_LowPerformer],
    FILTER(ALL('FY_Calendar'[Date]),
          'FY_Calendar'[Date]<= _MaxDate && 'FY_Calendar'[Date] >_MaxDate - 365
      ) )/ 12
 
Code 2:----
WorkTime_LowPerformer = COUNTROWS(
FILTER(
ADDCOLUMNS(
  SUMMARIZE(VW_NIPPON_PRODUCTIVITY,
            VW_NIPPON_PRODUCTIVITY[PERSONAL_ID],
            'FY_Calendar'[Year],
            'FY_Calendar'[Month]
            ),
         "@Hours",CALCULATE(SUMX(VW_NIPPON_PRODUCTIVITY,VW_NIPPON_PRODUCTIVITY[WT]))
         ),
     [@Hours] < 6 && [@Hours] > 0
     )
)
 
Kindly help me to find the expected result for this....
 
Regards,
Sagar

 

Hi @mangaus1111 ,

 

Can you please help to get the desired result as using the code it is not coming correctly which i posted in the above. Please help if possible.

 

Regards,

Sagar

Thanks a lot for your extended support on this..Really helped..

 

Regards,

Sagar

Hello @mangaus1111 ,

Thanks a lot for your quick support. just one quick check on this. Will this give me the result only for the Selected month in the Slicer or is it going to give me the average of  past 12 months Work TIme from the slicer slection!

Please help me to clarify this, because the table is showing the months of last 12 months of the  selected from slicer.

 

Regards,

Sagar

sagarsahoo_123
Helper IV
Helper IV

Hello Team,

Thanks for your quick support. Here i am attaching the PBIX file.

https://1drv.ms/u/s!AqNLfMSghxwyiGfJsfZ8GQtrrqWF?e=MWkbUZ

Please see the 1st page of it "Duplicate of Details" page. In this if you look at i have Peronal ID and their Work time for respective months. And in the end there is a total Work time for each user. I need to get the count of users who are clocking less than 6 hours in this Total.

 

Please help in getting the required data.

 

Regards,

Sagar

Anonymous
Not applicable

Hi @sagarsahoo_123 ,

It seems that I have no proper permission to your shared file. Could you please grant me the access to it? Thank you.

Best Regards

Hello,

Please check now with the below link.

https://1drv.ms/u/s!AqNLfMSghxwyiGfJsfZ8GQtrrqWF?e=YorLdm

 

Regards,

Sagar

Anonymous
Not applicable

Hi @sagarsahoo_123 ,

You can create a measure as below to get it and put it on the card visual:

Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[PERSONAL_ID] ),
    FILTER ( 'Table', [Total number of users] < 6 )
)

If the above one can't help you get the desired result, please provide some sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.