stayschemin
stayschemin

Reputation: 75

Duplicate Visualisation in Power BI, Same Measures and Column Headings, Different Data Source and Values

I have created a visualisation (table) with many different measures in Power BI, is there now a way to duplicate this visualisation but use a different data source with the same column headings (different values) where the measures and all are also duplicated?

Each measure serves to calculate a column in the visual:

For example, one of the measures that I created is this:

No of Sites = COUNT('All Sites TP1'[Facility Country]) Where 'All Sites TP1 is the first data source.

Another measure is as so:

Performing Sites = CALCULATE( 'All Sites TP1'[No of Sites], OR( 'All Sites TP1'[Site Status]="Completed", 'All Sites TP1'[Site Status]="Ongoing" ) )

The other calculated measures exist for the columns which are not blacked out, taking a similar form to the ones above.

I now want the exact same visualisation with measures to be created on a different tab of the dashboard, but for my second data source 'All Sites KN' (which contains identical column headings).

I want both of these visualisations to exist simultaneously on the same report. I could replicate every single calculated measure and simply change the data source - but this seems quite long winded and I wanted to enquire and see if there may be a workaround.

Thank you in advance, any assistance and insights will be appreciated.

Upvotes: 0

Views: 633

Answers (1)

Sam Nseir
Sam Nseir

Reputation: 12111

There isn't a quick way to do what you are after. However, I would recommend you append both tables together in PowerQuery, with a Custom Column to distinguish between the two. Once that is done, you can use the same measures and duplicate the visual, then set a visual filter on the Custom Column for each.

Steps

  1. In Report view, right-click on table All Sites TP1 and rename it to All Sites.
  2. In PowerQuery (via Transform data in the home tab in the ribbon), find the All Sites query, and add a Custom Column. Call it Source with a formula of = "TP1".
    enter image description here
  3. In PowerQuery, find the All Sites KN query, and add a Custom Column. Call it Source with a formula of = "KN".
  4. Optional - In PowerQuery, right-click on the All Sites KN query, and deselect Enable load. This will remove this table from Report view (you won't need it).
  5. In PowerQuery, go back to the All Sites query. Select Append Queries in the Home tab in the ribbon. In the pop-up box, select All Sites KN in the drop down and click OK.
  6. Click Close & Apply in the Home tab in the ribbon, to load the changes and to get back to Report view.

The above steps have appended both tables into one, with column Source distinguishing between the two.

Select your Table visual in your report, and in the Filters pane on the right, add 'All Sites'[Source] column to Filters on this visual, and set it to is TP1.
enter image description here

Finally, copy this visual, paste it on a new page, and set the visual filter to KN.

Upvotes: 1

Related Questions