Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
142 | |
71 | |
64 | |
52 | |
50 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |