March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I have a question about a possible automation of a task on PBI.
I have a table like this :
Entity | App | Number of users 2020 | Number of users 2021 | Number of users 2022 |
Entity 1 | App 1 | 12 | 34 | 45 |
Entity 1 | App 2 | 23 | 21 | 32 |
Entity 1 | App 3 | 19 | 15 | 11 |
I decide to make a Bar Chart of the number of users in 2021 concerning the app 1.
Then I receive a second Excel file and merge the two tables on PBI, the file looks like this :
Entity | App | Number of users 2020 | Number of users 2021 | Number of users 2022 |
Entity 2 | App 1 | 28 | 45 | 22 |
Entity 2 | App 2 | 12 | 11 | 32 |
Entity 2 | App 3 | 19 | 24 | 21 |
So I have to do exactly the same Bar Chart but concerning Entity 2 this time.
Having a lot of entity to deal with, the tasks being simple but time-consuming. Is there a way to automate the creation of different Bar Charts when I update the table with the new data ?
Thank you in advance for your answers.
Solved! Go to Solution.
Hi @Anonymous ,
There is no way to automate the creation of different Bar Charts when you upload a second table to Desktop and still want to use the chart created by the fields of the first table. But you can use parameters in Power BI Desktop to do this which still need you to select the parameters manually. Here are steps.
1, In PowerBI Desktop, under the "Modeling" tab, click "New Parameter".
For example, the parameter created according to the above default value is to establish a sequence of integers from 0 to 20: 0, 1, 2, 3... 20, click OK, a slicer will appear on the canvas, because when creating a new parameter, there is a default option in the lower left corner: add a slicer to this page, you can adjust the value of the parameter by sliding the slicer.
2,After you upload the second table, you can create a measure to control the display of the chart.
Measure =
IF (
SELECTEDVALUE ( Parameter[Parameter] ) = 0,
MAX ( 'Table1'[Number of users 2021] ),
IF (
SELECTEDVALUE ( Parameter[Parameter] ) = 1,
MAX ( 'Table2'[Number of users 2021] )
)
)
3, Put "App" and "Measure" into a chart.
4, Then you can get the chart you want accoding to the selected value of the slicer as below.
If you have more EXCEL files, you can add conditions in IF function.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
There is no way to automate the creation of different Bar Charts when you upload a second table to Desktop and still want to use the chart created by the fields of the first table. But you can use parameters in Power BI Desktop to do this which still need you to select the parameters manually. Here are steps.
1, In PowerBI Desktop, under the "Modeling" tab, click "New Parameter".
For example, the parameter created according to the above default value is to establish a sequence of integers from 0 to 20: 0, 1, 2, 3... 20, click OK, a slicer will appear on the canvas, because when creating a new parameter, there is a default option in the lower left corner: add a slicer to this page, you can adjust the value of the parameter by sliding the slicer.
2,After you upload the second table, you can create a measure to control the display of the chart.
Measure =
IF (
SELECTEDVALUE ( Parameter[Parameter] ) = 0,
MAX ( 'Table1'[Number of users 2021] ),
IF (
SELECTEDVALUE ( Parameter[Parameter] ) = 1,
MAX ( 'Table2'[Number of users 2021] )
)
)
3, Put "App" and "Measure" into a chart.
4, Then you can get the chart you want accoding to the selected value of the slicer as below.
If you have more EXCEL files, you can add conditions in IF function.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, it helped me greatly so that I didn't repeat the same tasks over and over again!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |