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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
WinterGarden
Resolver I
Resolver I

Matrix calculation Issue - DAX

Hi All,


I have a matrix visual similar to below table, where i have to show "Billable_Utilization"(2nd Column)
Billable_Utilization = (Billable_Hours / (Standard_Hr1 - Leave_Hours))*100

As per the data i am getting values similar to 2nd column(Billable_Utilization - As per my calculation)
But the correct value of Billable Utilization should be like  Column 6( Correct Billable_Utilization )

RequestorBillable_Utilization - As per my calculationBillable_Hours  Standard_Hr1  Leave_Hours  Correct Billable_Utilization 
(Billable_Hours /(Standard_Hr1 - Leave_Hours))*100
A22.97%36.75160 25.52%     (36.75 / (160-16))*100
B15.27%24.43160 16.96% (24.43 / (160-16))*100
C14.84%23.75160 16.49% (23.75/(160-16))*100
D10.34%16.55160 11.49 (16.55/(160-16))*100
Non-Billable  16016 

WinterGarden_0-1768922830724.png

 

 

Below is the dax:

1) Billable_Utl = DIVIDE([Billable_Hours],[Standard_Hr1]-[Leave_Hours])

2)
Billable_Hours = CALCULATE(SUM(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Time_In_Hr]),FILTER(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User,vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Billable]="Billable"))
 
3) Standard_Hr1 = sum(vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data[stdd_hr] )

4)
Leave_Hours =
CALCULATE(
    SUM(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Time_In_Hr]),
    REMOVEFILTERS(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorName],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorArea],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorRegion],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorCountry]
        ),
    KEEPFILTERS(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Leave_Type] IN {"Holiday", "LeaveType"})
)

How to modify this dax so that i will get Leave_Hours in other rows (A, B, C, D). Here the problem is i need to populate the Leave_Hours in all rows.. the Leave_Hours (non-Billable = 16) are not being considered in the calculation.That's why iam getting wrong % in column 2.

Please note that "Standard_Hr1" is from a different table, but other values Billable_Hours , Leave_Hours are from the same table.

1 ACCEPTED SOLUTION

@krishnakanth240 ,
Hi ,
This is giving correct billable utilization values, but  the problem is that other resources sponsors are also showing(The rows were Time_in_Hr and Billable_Utl columns are blank) since we removed the filters on the requestors.. 

Also the Non Billable_Utl should be blank for all requestors except Requestor = "Non- Billable" (it is showing 18.04% for all requestors..)

WinterGarden_0-1769178952674.png


if i apply Time_In_Hr = is not blank on the filter pane of this matrix visual it will work.. But this Leave_Hour measure is causing issue in my another table viusual.. where all requestors are showing irrespective of the resource name..

So i created a duplicate of the table( vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User) where i filtered only the non billable rows(Billable column = Non-Billable) .. and updated the measures accordingly.. and it is working fine..

Thank you so much for all the suggestions 🙂 I really appreciate it.



View solution in original post

12 REPLIES 12
GaloyanTelman
Frequent Visitor

 

Leave_Hours =
CALCULATE (
    SUM ( vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Time_In_Hr] ),
    REMOVEFILTERS (
        vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorName],
        vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorArea],
        vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorRegion],
        vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorCountry]
    ),
    ALLSELECTED ( vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Requestor] ),
    KEEPFILTERS ( vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Leave_Type]
        IN { "Holiday", "LeaveType" } )
)

 

Hi @GaloyanTelman ,

This one was giving correct billable utilization values..
But was showing all the requestor names irrespective of the resource name.. Like requestors of other resources are also displaying in the matrix visual.

krishnakanth240
Power Participant
Power Participant

Hi @WinterGarden 

 

Can you provide the sample data of columns with the tables to work on the above DAX measures to check. Thank you!

Hi @krishnakanth240 ,
This is the sample data, please note that i have two filters FiscalWeek and resource name..

FiscalWeekResourceRequestorBillableLeave_TypeTime_In_Hr
20PBABillable 9.3
21PBABillable 10.83
22PBABillable 6.75
23PBABillable 9.87
20PBBBillable 6.23
21PBBBillable 4.17
22PBBBillable 4.7
23PBBBillable 9.33
20PBCBillable 8.28
21PBCBillable 5.98
22PBCBillable 5.62
23PBCBillable 3.87
20PBDBillable 1.62
21PBDBillable 8.62
22PBDBillable 3.31
23PBDBillable 3
20PBNon-BillableNon-BillableNULL0
21PBNon-BillableNon-BillableNULL0
22PBNon-BillableNon-BillableLeaveType16
23PBNon-BillableNon-BillableNULL0



Standard_Hr1 is from a different table(vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data), that has many to many relationship with the table: vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User


Below is the sample data for standard hour:

FiscalWeekResourcestdd_hr
20PB40
21PB40
22PB40
23PB40

Hi @WinterGarden 

Thanks for sharing for one table.

Could you please share these inputs.

a)Some more data of records for these columns(Fiscal Week, Resource, stdd_hr) for 'Table' - vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data

 

b)Sample data of rows for these columns(SponsorName, SponsorArea, SponsorRegion, SponsorCountry) with records for the above 'Table' you shared - vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User

Hi @krishnakanth240 ,

a) vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data : stdd_hr is same for all the resource.. 40 hrs per week

b) (SponsorName, SponsorArea, SponsorRegion, SponsorCountry):
AJT, APAC, OCEANIA, Australia - for all rows

Hi @WinterGarden 

 

Thanks for sharing!

 

Want to clarify from which table these columns are coming from 

RequestorBillable_Utilization - As per my calculationBillable_Hours  Standard_Hr1  Leave_Hours

 

It's confusing actually. Can you give all the list of table names along with the columns and 30 sample records for it to work on DAX. Thank You!

Hi @krishnakanth240 ,

There are two tables
1)vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User:

 FiscalWeek  Resource  Resource_GPN  Requestor  BillableLeave_Type Time_In_Hr  SponsorName   SponsorArea   SponsorRegion   SponsorCountry   Week_GPN  
20PBPB01ABillable 9.3AJTAPACOCEANIAAustralia20PB01
21PBPB01ABillable 10.83AJTAPACOCEANIAAustralia21PB01
22PBPB01ABillable 6.75AJTAPACOCEANIAAustralia22PB01
23PBPB01ABillable 9.87AJTAPACOCEANIAAustralia23PB01
20PBPB01BBillable 6.23AJTAPACOCEANIAAustralia20PB01
21PBPB01BBillable 4.17AJTAPACOCEANIAAustralia21PB01
22PBPB01BBillable 4.7AJTAPACOCEANIAAustralia22PB01
23PBPB01BBillable 9.33AJTAPACOCEANIAAustralia23PB01
20PBPB01CBillable 8.28AJTAPACOCEANIAAustralia20PB01
21PBPB01CBillable 5.98AJTAPACOCEANIAAustralia21PB01
22PBPB01CBillable 5.62AJTAPACOCEANIAAustralia22PB01
23PBPB01CBillable 3.87AJTAPACOCEANIAAustralia23PB01
20PBPB01DBillable 1.62AJTAPACOCEANIAAustralia20PB01
21PBPB01DBillable 8.62AJTAPACOCEANIAAustralia21PB01
22PBPB01DBillable 3.31AJTAPACOCEANIAAustralia22PB01
23PBPB01DBillable 3AJTAPACOCEANIAAustralia23PB01
20PBPB01Non-BillableNon-BillableNULL0AJTAPACOCEANIAAustralia20PB01
21PBPB01Non-BillableNon-BillableNULL0AJTAPACOCEANIAAustralia21PB01
22PBPB01Non-BillableNon-BillableLeaveType16AJTAPACOCEANIAAustralia22PB01
23PBPB01Non-BillableNon-BillableNULL0AJTAPACOCEANIAAustralia23PB01


2)vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data

 FiscalWeek  Resource  stdd_hr  Resource_GPN  Week_GPN 
20PB40PB0120PB01
21PB40PB0121PB01
22PB40PB0122PB01
23PB40PB0123PB01


# Requestor - is from Table 1(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User)

 

# Billable_Utilization - DIVIDE([Billable_Hours],[Standard_Hr1]-[Leave_Hours])

 

# Billable_Hours = CALCULATE(SUM(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Time_In_Hr]),FILTER(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User,vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Billable]="Billable"))
------Billable_Hours is from Table 1(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User)-----

 

# Standard_Hr1 = sum(vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data[stdd_hr] )
----Standard_Hr1  is from Table 2(vw_EHub_Fiscal_Calendar_Headcount_Tracker_Data)-----

Leave_Hours =

CALCULATE(
    SUM(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Time_In_Hr]),
    REMOVEFILTERS(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorName],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorArea],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorRegion],
                  vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[SponsorCountry]
        ),
   KEEPFILTERS(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User[Leave_Type] IN {"Holiday""LeaveType"})
)
---Leave_Hours is from Table 1(vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User)----

Also note that there is one - to - many relationship between Table 2 and Table 1 using "Week_GPN" column

Hi @WinterGarden 

Thanks for sharing!

 

Leave hours measure I have tried with sample data. It is working after adding Requestor column. Can you please try and confirm

krishnakanth240_0-1769106764622.pngkrishnakanth240_1-1769106826989.png

 

@krishnakanth240 ,
Hi ,
This is giving correct billable utilization values, but  the problem is that other resources sponsors are also showing(The rows were Time_in_Hr and Billable_Utl columns are blank) since we removed the filters on the requestors.. 

Also the Non Billable_Utl should be blank for all requestors except Requestor = "Non- Billable" (it is showing 18.04% for all requestors..)

WinterGarden_0-1769178952674.png


if i apply Time_In_Hr = is not blank on the filter pane of this matrix visual it will work.. But this Leave_Hour measure is causing issue in my another table viusual.. where all requestors are showing irrespective of the resource name..

So i created a duplicate of the table( vw_Timely_Ehub_EA_Work_Flow_Tracker_Data_User) where i filtered only the non billable rows(Billable column = Non-Billable) .. and updated the measures accordingly.. and it is working fine..

Thank you so much for all the suggestions 🙂 I really appreciate it.



Hi @WinterGarden,

 

Thank you @krishnakanth240 and @GaloyanTelman for the prompt response. 

 

Thank you for confirming that the issue is resolved now. Thank you for being part of Microsoft Fabric Community.

 

Thanks and regards,

Anjan Kumar Chippa

That's great to hear @WinterGarden it got solved.

 

If the approach has helped to meet requirement, please give a heads-up/accept as a solution. Thank you!

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.