I'm using Power Query to bring together about 300 Excel documents, each with many sheets. There are so many data items that a full refresh in the Power BI Desktop takes too long for efficient development, so I use a Keep Top 5 rows step to cut down the bulk of data for these purposes.
Once testing of a change has been completed though, I want to publish to the Power BI Service a version of the model with no filter and schedule an overnight run.
To simplify deploy processes, I'm looking for a way to leave a permanent line of code in the query that will restrict to only the top 5 rows when running on the Desktop, but use all of the data if running on the Service. Is such a thing possible?
I've added this as an idea on the Power BI website - so if this is new then please vote it up https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/20439535-enviroment-sensitive-m