cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasWeppler
Continued Contributor
Continued Contributor

How to only sum up part of a matrix

Hi Power BI community
I have two tabels.

A tabel with all my Main projects (1)

And a tabel with Main projects (1), sub projects (2) and connected projects (3)
These two tabels are liked together so all projects, sub projects and connected projects can be show as just projects when I drill up.

However as I drill down in the matrix I need to write some DAX that allows me to see Main projects and subprojects as one  and to see each other projects for themselves. However this must not change the results I see when I drill all the way up and only see the summarized main project.

problem.png

 

I hope this make sense and all help is truely appreciated.

1 ACCEPTED SOLUTION
ThomasWeppler
Continued Contributor
Continued Contributor

@ ended up adding this colum to the second tabel.

opg. =
var _toproject = IF(Assignment[sub projects] = "To project", 1,0)
return
IF(_toproject = 1,
LOOKUPVALUE('Project'[Main projects], 'Project'[Main projects], Assignment[Main projects]), Assignment[Main projects])

Sometimes the simplest way is the best way and a fairly simple if function did the trick.



View solution in original post

2 REPLIES 2
ThomasWeppler
Continued Contributor
Continued Contributor

@ ended up adding this colum to the second tabel.

opg. =
var _toproject = IF(Assignment[sub projects] = "To project", 1,0)
return
IF(_toproject = 1,
LOOKUPVALUE('Project'[Main projects], 'Project'[Main projects], Assignment[Main projects]), Assignment[Main projects])

Sometimes the simplest way is the best way and a fairly simple if function did the trick.



v-yiruan-msft
Community Support
Community Support

Hi @ThomasWeppler ,

I'm not clear about your requirement. Could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, is there any relationship between these two tables(include Main projects (1), sub projects (2) and connected projects (3))? If yes, please provide the related info. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors