Forum Discussion
Using Windows environment variable in a PowerBI desktop parameter
I have yet to get this to work right. I don't know why we can't put in %USERNAME% to dynamically shift document locations. I have hundreds of students that access a PBIX file that is created from an Excel file each sememster. Getting them to know where to put the excel file is very painful.
What I do, is I create two parametmers. FilePath and Filename. I put them in a group called File Location. (1)
Curernt Value for FilePath is C:\ITM310 Filename is name of the excel file used to build the PBIX file. Put a \ before the file name. (In my instance the file name doesn't change, but the folder name does.)
Then, for the source (2) in each table, I go in and set the excel workbook to Advanced (3) and use the Filepath Parts. I pull the parameters for FilePath and Filename. It then puts them together: {FilePath}{Filename} .(4)
It's not the best method, but it is bette than nothing. This is something I have been trying to rectify for a few years now.