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.
Hello,
I am new to power bi and just now learning about templates. I have imported a few csv files into my project. I now want to be able to export a template so that anyone in my comany can import their data and get the same visuals that I have set up. My issue is that I have set up a parameter, but when I try to enter in a new data file in the template it loads the data that the template was created from.
How do you set up a template that lets you import in the data that you want?
Solved! Go to Solution.
Hi @Anonymous
Or follow the document below
https://www.seerinteractive.com/blog/how-to-create-a-power-bi-template/
As tested, it works.
Please uncheck the "required" option and use parameter in your connection query.
Then close&&apply, go to report view, creat visuals.
when save, select "save as "->***.pbit
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
this mainly depends on where you store your CSV files and how you told Power BI to access them.
If you stored them in your personal documents folder then other users will have to modify the data source settings to point to their personal folder. If you stored them in a commonly accessible OneDrive then the template will work as is with the same data.
In any case you may just need to educate your user how to modify the data source settings.
@lbendlin Our files are currently stored in a shared folder. The parameter is set to ask the user for the file location. Once the new file location is added to access the new files the template loads in the original files instead of the new ones.
The parameter is set up as a text and the Current value is the csv file. When opening the template it then promps you to enter a new file location.
The source of my file is an excel workbook with the file contents of the file location.
Hi @Anonymous
Or follow the document below
https://www.seerinteractive.com/blog/how-to-create-a-power-bi-template/
As tested, it works.
Please uncheck the "required" option and use parameter in your connection query.
Then close&&apply, go to report view, creat visuals.
when save, select "save as "->***.pbit
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can create a query like
(filename as text)=>
let
Source = Csv.Document(File.Contents("*******your file location\"&filename&".csv"),[Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type date}, {"value", Int64.Type}})
in
#"Changed Type"
Best Regards
Maggie
You'll want to validate your M code then. Remember code does what you tell it to do, not always what you want it to do 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.