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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Matrix drill-down > subtotal from multiple columns

Hey,

 

I have a problem showing the correct subtotals in a matrix when drilling down to the next level.

 

What I have

2 datasets:

  • Tasks, containing - among others - the following columns:
    • Task ID (link to other dataset)
    • Task Name
    • Task Budget
  • Sub-tasks, containing - among others - the following columns:
    • Sub-task ID
    • Sub-task name
    • Sub-task budget
    • Task ID (link to other dataset)

Now, what I want to do is show a matrix listing all the Task names as rows, and their respective data (e.g. budget).

As second row level in the matrix I use Sub-tasks. In each row I want to show several metrics, mostly based on the budget, like budget left, required per day, etc. 

 

In my current setup however, I use the sum of Task budget as my leading budget amount. So, firstly the Task budget is carried over when I expand to the next level, like in the figure below:

 

PowerBi Table.png

 

Now the sub-task budget sometimes has a value, and sometimes doesn't. So the budget has to be calculated conditionally I guess.

 

Ideally, I want to have:

  • the task budget always shown (when expanded it is shown as subtotal)
  • the sub-task budget shown when it has a value in the dataset
  • the sub-task budget not show any thing when it has no value in the dataset.

Can anybody help me achieve this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

Create the following measures in  the projects table.

sum of task budget = SUM(tasks[Task Budget])

 

sum of project budget = CALCULATE(SUM(projects[Project Budget]),FILTER(projects,CALCULATE(COUNTROWS(FILTER(tasks,tasks[Project ID]=RELATED(projects[Project ID])))>0)))
Budget = IF(ISBLANK([sum of task budget]),[sum of project budget],[sum of task budget])


1.JPG
Regards,
Lydia

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Anonymous,

Could you please help to post dummy data of the above two tables and post expected result based on the dummy data here?

Regards,
Lydia

Anonymous
Not applicable

Hi Lydia,

 

Please find the pbix file containing the dummy data here: https://we.tl/aE9nawgnR8. I used a wetransfer link because I couldn't find a way to add a .pbix as attachment.

 

Now what I get is:

IST.jpg

And what I want is this:

SOLL.jpg

So, I want to still show all the project budgets, and want to show only the task budgets if they have a value. Also, it is important to have it in 1 column since I will be needing a lot of other metrics that are based on the budget (in a certain row).

 

I hope this clarifies it a bit more.

Anonymous
Not applicable

@Anonymous,

Create the following measures in  the projects table.

sum of task budget = SUM(tasks[Task Budget])

 

sum of project budget = CALCULATE(SUM(projects[Project Budget]),FILTER(projects,CALCULATE(COUNTROWS(FILTER(tasks,tasks[Project ID]=RELATED(projects[Project ID])))>0)))
Budget = IF(ISBLANK([sum of task budget]),[sum of project budget],[sum of task budget])


1.JPG
Regards,
Lydia

Anonymous
Not applicable

@Anonymous thanks!

 

Works like a charm.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors