Search code examples
mdxpowerbi

PowerBI blank data template


Currently I'm working on a dashboard template in PowerBI that will be piloted in the desktop version. The template is filled with data based on the user's authorization through a filter applied within the MDX query. However when spreading the template to others for piloting, it is still filled with data based on my personal authorizations which is only replaced as soon as the user refreshes using his personal authorizations.

I'm looking for a solution that does not break the template but also makes sure that my data is not shown to others when opening the template, in other words how can I make sure the user sees an empty template (no data) when opening the file.

I've tried blanking the filter parameter (results in data errors and missing columns thus breaking the dashboard)

Can anyone help me find a solution?


Solution

  • Thanks for the replies. I've managed to solve the problem with a simple solution. By adding a try structure around the Table.RenameColumns function after the MDX I was able to capture a blank query and use Table.FromRecords to manually add the otherwise retrieved columns with a blank row. This prevents all subsequent queries and measures from returning errors and thus blanking all figures when the user parameter is invalid. Then finally just add any invalid value to the user parameter and save as a template, voila.