Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi,
Im trying to work out from timesheet data how many hours all the employees have worked in a month my data is like so for example
| User | Total Hours | Date |
| Joe Bob | 6 | 1/01/2000 |
| Missy Moo | 7 | 1/01/2000 |
| Joe Bob | 4 | 2/01/2000 |
| Missy Moo | 3 | 2/01/2000 |
| Joe Bob | 5 | 3/01/2000 |
| Missy Moo | 7 | 3/01/2000 |
| Joe Bob | 7 | 1/02/2000 |
| Missy Moo | 8 | 1/02/2000 |
| Joe Bob | 9 | 2/02/2000 |
Im guessing i need to create a table that looks like the following
| Month | Total Hours |
| Jan-00 | 32 |
| Feb-00 | 24 |
Could some one show me how?
Also i know i can use the auto totals however i need to use the numbers further on in other calculations
Hi, @PowerBiNoob37
If you want to change the value of the matrix total field, you can refer to the following thread
Different DAX calculations for different row hierarchies in a matrix table? Independent subtotals?
then to create a measure similar to this:
_Switch =
// VAR _IF=
// IF(
// ISINSCOPE(financials[Year])&&ISINSCOPE(financials[Product]),
// IF(
// ISINSCOPE(financials[Country]),
// _VALUE,
// _SUBTOTAL),
// _TOTAL)
VAR _SWITCH=
SWITCH(
TRUE(),
ISINSCOPE(financials[Country])&&ISINSCOPE(financials[Product]),1,
ISINSCOPE(financials[Year])&&ISINSCOPE(financials[Product]),2,
ISINSCOPE(financials[Year])&& NOT(ISINSCOPE(financials[Product])),3,
NOT(ISINSCOPE(financials[Year])),4
)
RETURN _SWITCH
You can change it the way you want.
Result:
Please refer to the attachment below for details. Hope it helps.
If it's not helpful to your case, please consider sharing the sample, it's hard to reproduce your scenario if it's not clear what kind of data model you have.
No need to show real data, you can always create some short dummy dataset to illustrate your issue.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pretend the numbers here are mathamatically correct i want it too look exactly like this and then i can use a slicer to zone in on the dates..
@PowerBiNoob37 I would recommend the following:
Total Hours (measure) = SUM(Table[Total Hours]
Ive more or less done this however it isnt working for me,
I created a Date Table like normal
SUM(Table[Total Hours]
Hi,
In the Formatting pane, under the values group, turn on Show on rows.
That doesnt work it just displays it differently, i think im doing something wrong, like the measures are right it worked out the whole total but it doesnt display the measure for the month i.e the 3,984.45 is the Total Hours all up for every employee for the total time period, where as i want it to measure each month seperatly..
Hi,
Share the link from where i can download your PBI file.
I cant it contains sensitive data. I think the issue is the measure is wrong for what im trying to achieve
im trying to create this
When my data in one table ill call EmployeeHours is like this
| User | Total Hours | Date |
| Joe Bob | 6 | 1/01/2000 |
| Missy Moo | 7 | 1/01/2000 |
| Joe Bob | 4 | 2/01/2000 |
| Missy Moo | 3 | 2/01/2000 |
| Joe Bob | 5 | 3/01/2000 |
| Missy Moo | 7 | 3/01/2000 |
| Joe Bob | 7 | 1/02/2000 |
| Missy Moo | 8 | 1/02/2000 |
| Joe Bob | 9 | 2/02/2000 |
and another like this ill call SafetyTotals
| Type | date |
| safety | 1/02/2000 |
| safety | 1/03/2000 |
| nly | 1/01/2000 |
| nly | 1/02/2000 |
| int | 1/01/2000 |
I have a table ive created using the following
and if i add the measure i get the table like ive shown before
if change it too your suggestion i get this sort of thing not the one i want
Hi,
In the Calendar Table, create the Year, Month Name and Month number columns. Sort the Month Name column by the Month Number column. Drag the Year and Month Name columns to your matrix visual from the Calendar Table.
Hope this helps.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!