March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello all,
I'm hoping this will be a fairly straightforward question for the group. I've tried several solutions I've found on this forum, but I haven't achieved the results I want. I'm new to learning DAX, so I'm not sure if it's my data model or I'm simply choosing the wrong functions.
I have a list from SharePoint online that has a list of applications used by our organization (FACT table), the departments that utilize the application, the group who manages the application, and the primary and secondary admins. In my first approach, I created DIM tables for Primary Admin, Secondary Admin from the internal SP Users info, and Department from the original (FACT) table. Each of the DIM tables have bi-directional relationships with the FACT table. I was then able to create visuals that would cross filter each other (e.g. selecting the visual with just the applications, would filter the Deparment, Managed By, PrimaryAdmin and SecondaryAdmin, etc). Next I created a table showing all applications and slicer with all Admins (new DIM), where the user could chose an Admin and see all applications where they were listed as either Primary or Secondary.
Now I have a request to remove inactive users from the visuals. The problem, my Users are pulling from SharePoint Online and not Azure or on prem AD. This is because the end users do not have access to users in AD or Azure, but can view the information from SharePoint. However, SharePoint Online doesn't automatically remove inactive users. I tried to resolve this by recreating my Primary and Secondary Admin tables from the FACT table, but I ended up with duplicates using the following:
Solved! Go to Solution.
Hello @CathyWork , you can achieve the equivalent of SELECT DISTINCT using the DISTINCT function.
Source references as a primer to DAX - DISTINCT is included below:
DISTINCT (column) function (DAX) - DAX | Microsoft Learn
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you. Proud to be a Super User!
Hi Liu Yang,
Thanks for the SQL info, I may use it in a different project. I'm familiar with SQL, but I was trying to find a DAX equivalent to the SELECT DISTINCT since my original data is in SharePoint and not in a SQL DB.
Cathy
Hello @CathyWork , you can achieve the equivalent of SELECT DISTINCT using the DISTINCT function.
Source references as a primer to DAX - DISTINCT is included below:
DISTINCT (column) function (DAX) - DAX | Microsoft Learn
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you. Proud to be a Super User!
Hi @CathyWork ,
Are you referring to creating a table using SQL statements in Power BI? As far as I know, Power BI does not currently support this feature. The supported languages in Power BI are DAX functions and M language. You can create calculated tables using DAX or utilize Power Query and M language to create tables.
Additionally, you can find the ‘Advanced options – SQL statement’ in the SQL Server connection interface within Power BI. Here, you can input SQL statements to preprocess tables.
Tutorial: Connect to on-premises data in SQL Server - Power BI | Microsoft Learn
You might consider creating a bridging table to join relationships:
Many-to-many relationship guidance - Power BI | Microsoft Learn
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
168 | |
116 | |
63 | |
57 | |
50 |