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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Percent of Category total (Row/Column Total)

I have a customer level data. In this data I am taking count of customers accross 2 variables and then checking the % accross these variables viz Varaiable category and variable Status (Absent/present).

Below is the screen shot of what I need and then plot in a clustered column. Suggest me the DAX formula to do so. 

Very hard to believe a very simple stuff in excel is so complicated in PowerBI

 

 
 

power_bi_screenshot.PNG

2 REPLIES 2
HotChilli
Super User
Super User

If I understand correctly, you need a clustered column chart and one measure

%present = SUM(TableK[Present]) / SUM(TableK[Grand Total])

and for the other field, drag Grand Total on to the chart and right-click-> select Show Value as -> percent of grand total

Anonymous
Not applicable

Something like this:

// 2 dimensions: 1) Category, 2) Attendance
// connected to a Fact table (1:*). Slicing only
// via dimensions, all columns in the fact
// table are hidden.
// I don't know the full structure of the
// table(s), so I can only write against
// the minimum correct setup I can imagine.

[# Customers] = countrows( 'Fact' )

[% of Base] =
var __totalWithoutAttendance =
	calculate(
		[# Customers],
		all( 'Attendance' )
	)
var __totalWithoutAttendanceAcrossVisibleCategories =
	calculate(
		[# Customers],
		all( 'Attendance' ),
		allselected( 'Category' )
	)
var __percent =
	divide(
		__totalWithoutAttendance,
		__totalWithoutAttendanceAcrossVisibleCategories
	)
return
	__percent
	
[% Present] =
var __totalPresent =
	calculate(
		[# Customers],
		'Attendance'[Status] = "present",
		all( 'Attendance' )
	)
var __total =
	calculate(
		[# Customers],
		all( 'Attendance' )
	)
var __percent =
	divide(
		__totalPresent,
		__total
	)
return
	__percent
	

 

Best

D

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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