The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
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
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
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
14 | |
12 | |
12 | |
7 |