Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jogrun87
New Member

Dynamically create Reference queries based on number distinct values in a column

Hi everyone, 

 

I have a base CSV that has a column called 'Usage'. Each time this CSV is generated the number of distinct values in the 'Usage' column will change.  Today it is 3, tomorrow it could be 7.  I need to build a separate query for each unique value, I can do this manually, only each time I may require more or less queries.

 

Is there a way to dynamically create 'n' queries in Power Query based on distinct values of a column? 

 

Thanks in advance

John

1 ACCEPTED SOLUTION
jogrun87
New Member

Thanks Pete, I thought this was the case, the XY probleem seems like it was written just for me :D.  I was over-thinking the problem completely.

 

I've gone with another (much simpler) method, of just adding cond. columns, that can each cater for a wider range of values.  Thank you for your reply

View solution in original post

2 REPLIES 2
jogrun87
New Member

Thanks Pete, I thought this was the case, the XY probleem seems like it was written just for me :D.  I was over-thinking the problem completely.

 

I've gone with another (much simpler) method, of just adding cond. columns, that can each cater for a wider range of values.  Thank you for your reply

BA_Pete
Super User
Super User

Hi John,

 

Firstly, no, you can't dynamically spawn new queries in Power Query.

Secondly, this looks like an XY Problem. If you can give more detail around what you're actually trying to achieve overall, I may be able to advise you on a better way to get to your end goal.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors