Dharma
April 19, 2022, 11:49am
1
Hello Team,
Am looking for 2nd level drill down value to be calculated to 100 percent, as you can see the below sample screenshot the split of 89 has to come to 100% percent but its coming to 08 (89%) (6 (67%)+1 (11%) +1 (11%)) can we get the split like 08 (89%) and below
(6 (75%) +1 (12.5%)+1 (12.5%).
I have attached PBIX file for your reference.
Percent_Sample_file.pbix (151.4 KB)
Harsh
April 19, 2022, 2:08pm
2
Hello @Dharma ,
Thank You for posting your query onto the Forum.
To achieve the results based on the condition that you’ve specified. Below is the measure alongwith the screenshot of the final results provided for the reference -
Percent Of Total - Harsh =
VAR _Total_Empls =
COUNTROWS( 'Data Table' )
VAR _Total_Empls_Each_Country =
CALCULATE( COUNTROWS( 'Data Table' ) ,
ALLSELECTED( 'Data Table'[Country] ) )
VAR _Total_Empls_Each_Type =
CALCULATE( COUNTROWS( 'Data Table' ) ,
ALLSELECTED( 'Data Table'[Country] ,
'Data Table'[Order] ,
'Data Table'[Type] ) )
VAR _Percent_of_Total_Empls_Type_Level =
DIVIDE( _Total_Empls , _Total_Empls_Each_Type , 0 )
VAR _Percent_of_Total_Empls_Country_Level =
DIVIDE( _Total_Empls , _Total_Empls_Each_Country , 0 )
VAR _Results_For_Type_Level =
FORMAT( _Total_Empls , "0,0" ) &" ("& FORMAT( _Percent_of_Total_Empls_Type_Level , "0.00%" ) & ")"
VAR _Results_For_Country_Level =
FORMAT( _Total_Empls , "0,0" ) &" ("& FORMAT( _Percent_of_Total_Empls_Country_Level , "0.00%" ) & ")"
VAR _Results =
SWITCH( TRUE() ,
ISINSCOPE( 'Data Table'[Country] ) , _Results_For_Country_Level ,
ISINSCOPE( 'Data Table'[Type] ) , _Results_For_Type_Level ,
_Results_For_Type_Level )
RETURN
_Results
I’m also attaching the working of the PBIX file for the reference purposes.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Thanks and Warm Regards,
Harsh
Percent_Sample_file - Harsh.pbix (150.7 KB)
4 Likes
Dharma
April 21, 2022, 9:17am
3
Thank you @Harsh as always very precise solution…
1 Like
Harsh
April 21, 2022, 9:59am
4
Hello @Dharma ,
You’re Welcome!!
I’m glad that I was able to assist you.
Thanks and Warm Regards,
Harsh
1 Like