Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hello, for a report I am building I need to get the reporting structure of each user in the report. I have a list of user emails like this
And I have a custom function I run that calls an API that gets the users management structure. This works great but currently this custom function runs on every single row, even if I have already run it for a user
= Table.AddColumn(#"Changed Type3", "SVP", each try fnGetSVP([AssignedTo.UserEmail]) otherwise "")
This is a large table which means I'm making tens of thousands of API calls, even though there are only ~700 unique users in the table, so the vast majority of those API calls are duplicates which drastically increases the the time it takes the report to run. I cannot use the built in "Remove Duplicates" function because I need to preserve every row for the final report, and it doesnt look like there is a good way to remove duplicates and preserve each row.
So what I'm looking for is a way to run the function only on unique values. I've tried a few different things, such as extracting the column, removing duplicates, running the function, then creating a one to many relationship back with my original query but that didn't work. If there is a way to do this I'd appreciate the intel!
Solved! Go to Solution.
Creat another query including the unique emails, then call the app for the unique list of emails and then merge it's result with your table.
Creat another query including the unique emails, then call the app for the unique list of emails and then merge it's result with your table.
And I have a custom function I run that calls an API that gets the users management structure
There's no need for that. Let the PATH DAX function do the work for you.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.