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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.