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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Gruja
New Member

Link table data with measures data and display in a visual

I’m working on a Power BI report and need assistance with combining forecasted and actual space data, while ensuring the ability to filter the data by Kostenstelle (department). Below is my data model setup and the approach I’m using:

Data Model:

I have a few key tables in my model:

    • Kostenstelle (group identifier)
    • Subdepartment
    • Department

      dimNutzerstructure (dimension table containing user categories):

Gruja_0-1736414541828.png

Example entries:

KostenstelleSubdepartmentDepartment
021102Financial_1Banking
021103Financial_2Banking
011112PersonalHR

 

2. ExportRDB (room data):

  • RoomID
  • Kostenstelle
  • Fläche in m² (area)
  • DIN277-1 (room type: e.g., NUF2 for office, NUF4 for storage)

Example entries:

RoomIDKostenstelleFläche in m² (area)DIN277-1 (type)
102110210NUF2
202110220NUF4
301111215NUF2

 

3. factPersonaltapete (user data):

  • Kostenstelle
  • Name
  • Department

Example entries:

KostenstelleNameDepartment
021102John DoeBanking
011112Max MustermannHR

Measures:

I am using the following measures to calculate space needs for each user category:

  1. Bürobedarf (forecasted office space):

 

Bürobedarf = 
SUMX(
    VALUES('factPersonaltapete'[MA-Kategorie]), 
    [Anzahl Angestellte] * 
    LOOKUPVALUE(
        'Bueroflaechenrichtwerte'[Büro - Richtwert, m²],
        'Bueroflaechenrichtwerte'[Dienstbezeichnung], 
        'factPersonaltapete'[MA-Kategorie]
    )
)

 

2. Anzahl Angestellte (number of employees):

 

Anzahl Angestellte = COUNTROWS('factPersonaltapete')

 

3. Lagerbedarf (forecasted storage space):

 

Lagerbedarf = [Bürobedarf] * 0.05

 

To get the actual amount of office and storage space, I calculate the sum of the Fläche in m² column from the ExportRDB table, categorized by the DIN277-1 column (with values NUF2 for office space and NUF4 for storage space).

Approach:

I created a ComparisonTable using UNION to combine forecasted and actual space data:

 

ComparisonTable = 
UNION(
    ROW("Category", "Office Space", "Forecasted", [Bürobedarf], "Actual", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1] = "NUF2"), 'Export RDB'[Raum - Fläche in m²])),
    ROW("Category", "Storage Space", "Forecasted", [Lagerbedarf], "Actual", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]  = "NUF4"),'Export RDB'[Raum - Fläche in m²])),
    ROW("Category", "Laboratory Space", "Forecasted", [Gesamt Laborbedarf], "Actual", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]= "NUF3"), 'Export RDB'[Raum - Fläche in m²])
))

 

Result

Gruja_1-1736414885169.png

Issue:

I am unable to filter this visual with the Kostenstelle column to display both the used and forecasted space for each department.

Question:

  1. Is the approach I’m using reasonable, or am I missing something in my logic?
  2. How can I combine the data from these measures with the data from the ExportRDB table, while still enabling filtering by Kostenstelle (department) in my visual?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Gruja 

 

ComparisonTable is a calculated table. A calculated table cannot be filtered by filters or slicers in the report. You can consider its data is static when you interact with the report. 

 

To have a dynamic result displayed, you need to use a measure to populate the column visual. 

 

A common practice is to add an additional table which has category values to be displayed on x-axis. For example, table 'DimCategory':

vjingzhanmsft_0-1736751540955.png

 

Create measures to calculate the Forecasted value and Actual value separately. For example, 

Forecasted = 
SWITCH(
    SELECTEDVALUE('DimCategory'[Category]),
    "Office Space", [Bürobedarf],
    "Storage Space", [Lagerbedarf], 
    "Laboratory Space", [Gesamt Laborbedarf]
)
Actual = 
SWITCH(
    SELECTEDVALUE('DimCategory'[Category]),
    "Office Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1] = "NUF2"), 'Export RDB'[Raum - Fläche in m²]),
    "Storage Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]  = "NUF4"),'Export RDB'[Raum - Fläche in m²]), 
    "Laboratory Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]= "NUF3"), 'Export RDB'[Raum - Fläche in m²])
)

 

Place the new 'DimCategory' table's [Category] column to X-axis, and place the two new measures to Y-axis. 

 

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Gruja 

 

ComparisonTable is a calculated table. A calculated table cannot be filtered by filters or slicers in the report. You can consider its data is static when you interact with the report. 

 

To have a dynamic result displayed, you need to use a measure to populate the column visual. 

 

A common practice is to add an additional table which has category values to be displayed on x-axis. For example, table 'DimCategory':

vjingzhanmsft_0-1736751540955.png

 

Create measures to calculate the Forecasted value and Actual value separately. For example, 

Forecasted = 
SWITCH(
    SELECTEDVALUE('DimCategory'[Category]),
    "Office Space", [Bürobedarf],
    "Storage Space", [Lagerbedarf], 
    "Laboratory Space", [Gesamt Laborbedarf]
)
Actual = 
SWITCH(
    SELECTEDVALUE('DimCategory'[Category]),
    "Office Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1] = "NUF2"), 'Export RDB'[Raum - Fläche in m²]),
    "Storage Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]  = "NUF4"),'Export RDB'[Raum - Fläche in m²]), 
    "Laboratory Space", SUMX(FILTER('Export RDB', 'Export RDB'[DIN277-1]= "NUF3"), 'Export RDB'[Raum - Fläche in m²])
)

 

Place the new 'DimCategory' table's [Category] column to X-axis, and place the two new measures to Y-axis. 

 

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

MFelix
Super User
Super User

Hi @Gruja ,

 

You cannot use measures in Tables, measure are calculated at the time of the visualzaion call and are based on context so they are calculated at need.

When you add a measure to a physical table the context is not consider properly sinvce you change your filter context so they are not properly calculated.

 

Please check this link with explanation about measures and columns

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.