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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello All,
I have a sql query, which I need to mimic in PowerBI.
SELECT
COUNT(*), EMP_NAME, EMP_ID, YEAR, MONTH
FROM
EMPLOYEE
GROUP BY
EMP_NAME, EMP_ID, YEAR, MONTH
HAVING
COUNT(*) > 1
I have imported the table EMPLOYEE into Power BI.
Is it possible to do above query in Power BI
Creating a view in the DB is not an option.
Thanks in Advance.
Solved! Go to Solution.
Hi @Anonymous,
Since you have imported the source EMPLYEE table into Power BI, you can apply filter to it via creating a calculated table with the same logic of above SQL query.
Filter Employee =
FILTER (
SUMMARIZE (
EMPLOYEE,
EMPLOYEE[Emp_Name],
EMPLOYEE[EMP_ID],
EMPLOYEE[YEAR],
EMPLOYEE[MONTH],
"Count records", COUNTROWS ( EMPLOYEE )
),
[Count records] > 1
)
Besides, when you create the connection string, you can type above SQL Query so that you don't need to load all data records into Power BI.
Best regards,
Yuliana Gu
@Anonymous and @v-yulgu-msft
Additionaly, Instead of creating a summarize table using DAX, we can also achieve this using Group by Option in Power Query
@Anonymous and @v-yulgu-msft
Additionaly, Instead of creating a summarize table using DAX, we can also achieve this using Group by Option in Power Query
Hi @Anonymous,
Since you have imported the source EMPLYEE table into Power BI, you can apply filter to it via creating a calculated table with the same logic of above SQL query.
Filter Employee =
FILTER (
SUMMARIZE (
EMPLOYEE,
EMPLOYEE[Emp_Name],
EMPLOYEE[EMP_ID],
EMPLOYEE[YEAR],
EMPLOYEE[MONTH],
"Count records", COUNTROWS ( EMPLOYEE )
),
[Count records] > 1
)
Besides, when you create the connection string, you can type above SQL Query so that you don't need to load all data records into Power BI.
Best regards,
Yuliana Gu
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |