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!View all the Fabric Data Days sessions on demand. View schedule
Hello
how to translate this sql group by condition to dax measure to find distinct employee count based on selected value from slicers
select distinct id, name, date, location, count(1) from table a. group by id, name, date, location
Thanks
Vs
Solved! Go to Solution.
you get that for free in Power BI. It automatically aggregates/groups.
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
This measure worked for calculating the distinct row count for a group by statement
RowCount =
VAR table1 =
CALCULATETABLE (
Employee,
DISTINCT (
SELECTCOLUMNS (
Employee,
"ID", Employee[ID],
"Name", Employee[Name],
"Date", Employee[Date]
)
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( Employee[ID] ),
FILTER ( table1, Employee = 'USA' )
)
or
var emp = group by ( table, column1, column2, column 3 )
return calculate (distinctcount(id), filter(emp, filter condition column expression)
you get that for free in Power BI. It automatically aggregates/groups.
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!