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
marcel97
Helper II
Helper II

Recreating a Table Visual Total via Measure

Hello all,

 

in my organization's project management we compare different plan values and actual values of our projects. Projects that do not have one particular plan value are of particular interest.

 

In a first step I have created a table visual:

marcel97_9-1664541391927.png

 

Here I could simply filter for projects where PLAN_VALUE is 0, as those projects are the most interesting to me.  I then get the totals of all PLAN2 and ACTUAL values of the projects, that do not have a PLAN_VALUE

 

marcel97_8-1664541370217.png

 

I now need to recreate these totals through a measure and this is where I run into problems. As the table visual above sources data from multiple data tables, I cannot make a simple SUMX or CALCULATE calculation work:

 

marcel97_5-1664540802645.png

marcel97_7-1664540975002.png

Now I need measures that return:

- The totals of PLAN2_VALUE of all projects, where PLAN_VALUE is 0 (would be 6 in this example)

- The totals of ACTUALS of all projects, where PLAN_VALUE is 0 (would be 9 in this example)

 

Is there a way to achieve this?

 

Thanks and kind regards

Marcel

 

Please find attached the RAW DATA:

 

PLAN 1

PROJECT_IDTEAM_IDDATEPLAN_VALUE
11January 202210
12January 20220
21January 20225
22January 20225
31January 20220
32January 202210
41January 20220
42January 20220

 

PLAN 2

PROJECT_IDTEAM_IDDATEPLAN2_VALUE
11January 202210
12January 20228
21January 202210
22January 20228
31January 202210
32January 20228
41January 20223
42January 20223

 

ACTUAL

PROJECT_IDTEAM_IDDATEACTUALS
11January 20228
12January 20229
21January 202211
22January 202210
31January 20228
32January 20227
41January 20225
42January 20224

 

TEAM MASTER

TEAM_IDTEAM_NAME
1Team 1
2Team 2

 

PROJECT MASTER

PROJECT_IDPROJECT_NAME
1Project 1
2Project 2
3Project 3
4Project 4

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a measure like

Plan Value by Project = SUMX( 'Project master', SUMX( RELATEDTABLE('Plan 1'), 'Plan 1'[Plan value]))

which you can then use in a filter, like 

Plan 2 value =
SUMX (
    FILTER ( 'Project master', [Plan value by project] = 0 ),
    SUMX ( RELATEDTABLE ( 'Plan 2' ), 'Plan 2'[Plan value 2] )
)

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @marcel97 ,

 

Whether the advice given by @johnt75  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

johnt75
Super User
Super User

Create a measure like

Plan Value by Project = SUMX( 'Project master', SUMX( RELATEDTABLE('Plan 1'), 'Plan 1'[Plan value]))

which you can then use in a filter, like 

Plan 2 value =
SUMX (
    FILTER ( 'Project master', [Plan value by project] = 0 ),
    SUMX ( RELATEDTABLE ( 'Plan 2' ), 'Plan 2'[Plan value 2] )
)

Hey @johnt75 ,

 

this solution works if I include it in the table visual:

marcel97_0-1664875789611.png

However, if I want to include it in a column chart, it does not work and shows up as blank

 

marcel97_1-1664875875944.png

This is exactly the purpose for which I need the calculation. Is there a way to do it?

 

Thanks a lot and kind regards

Marcel

The measures I wrote work for me

johnt75_0-1664877953598.png

 

For some reason your measures are returning blank in the total row of the table, whereas mine returns the correct total. Are you applying any extra filters to the visuals ?

@johnt75 my bad! I had the measure included in Plan 2 Value as a variable. Having two separate measures as you intially proposed did the trick! Thanks a lot fpr the quick support and your insight!

 

Kind regards

Marcel

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.