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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I have the following situation. I want to calculate the % of leaves for a specific team and its members. The measure that I used is very basic:
%ofLeaves = [NrOfLeaves] / [AvailableResources]
The problem is that the value changes at manager/overall level if for example I remove the blanks on the column NrOfLeaves.
Can you please tell me what should I add in the formula to keep the original % values, both on a employee level and manager level ?
Thank you!
Hi @Bratone ,
Please try below steps:
1. below is my test table
2. create two meaure with below dax formula
Measure =
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[Manager] = SELECTEDVALUE ( 'Table'[Manager] )
)
VAR sum_nr =
SUMX ( tmp, [NrOfLeaves] )
VAR sum_ab =
SUMX ( tmp, [Availables] )
RETURN
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[Sub_Mg] ),
DIVIDE (
SELECTEDVALUE ( 'Table'[NrOfLeaves] ),
SELECTEDVALUE ( 'Table'[Availables] )
),
ISINSCOPE ( 'Table'[Manager] ), DIVIDE ( sum_nr, sum_ab ),
DIVIDE (
SUMX ( ALL ( 'Table' ), [NrOfLeaves] ),
SUMX ( ALL ( 'Table' ), [Availables] )
)
)
Measure2 =
VAR tmp =
CALCULATETABLE ( VALUES ( 'Table'[Sub_Mg] ), 'Table'[NrOfLeaves] = BLANK () )
VAR cur_submg =
SELECTEDVALUE ( 'Table'[Sub_Mg] )
RETURN
IF ( cur_submg IN tmp, 0, 1 )
3. add a matrix visual, then add fields and "Measure" to it, add "Measure 2" to the "Filters" pane
add measure to "Filter" pane is used to don't show the blank data.
Befor add:
After add:
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Thank you for taking the time to reply, the problem is that in my case, NrOfLeaves and AvailableResources are actually measures, not columns in the same raw data tabel:
Hi @Bratone ,
Since I don't know what your actual environment is like, I couldn't give you an exact answer, but for measure you could also use similar operations to columns, and I think my example is a good reference for you. Please try to adjust it by yourself.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.