Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Anonymous
Not applicable

Automatic creation of charts when the database is updated.

Hi all,
I have a question about a possible automation of a task on PBI.
I have a table like this :

Entity

AppNumber of users 2020Number of users 2021Number of users 2022

Entity 1

App 1123445

Entity 1

App 2232132

Entity 1

App 3191511

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 AppNumber of users 2020Number of users 2021Number of users 2022
Entity 2App 1284522
Entity 2 App 2 121132
Entity 2 App 3192421

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.

1 ACCEPTED SOLUTION
v-xiaosun-msft
Community Support
Community Support

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".

vxiaosunmsft_0-1669792998446.pngvxiaosunmsft_1-1669793014154.png

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.

vxiaosunmsft_2-1669793209133.png

4, Then you can get the chart you want accoding to the selected value of the slicer as below.

vxiaosunmsft_3-1669793303472.pngvxiaosunmsft_4-1669793316821.png

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.

View solution in original post

2 REPLIES 2
v-xiaosun-msft
Community Support
Community Support

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".

vxiaosunmsft_0-1669792998446.pngvxiaosunmsft_1-1669793014154.png

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.

vxiaosunmsft_2-1669793209133.png

4, Then you can get the chart you want accoding to the selected value of the slicer as below.

vxiaosunmsft_3-1669793303472.pngvxiaosunmsft_4-1669793316821.png

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.

Anonymous
Not applicable

Thank you, it helped me greatly so that I didn't repeat the same tasks over and over again!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.