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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Chris_cons
New Member

How to get a subtotal and a total

Hello,

 

i am new to power bi, and i am struggling with something i believed would be basic.

 

i have a datatable with this structure (simplified):

Project Epic US US done (1 if done)
P1E1US11
P1E1US20
P1E1US30
P1E2US41
P1E2US51
P2E3US61
P2E3US7

1

 

"US done" tells me if the user story is done (1) or not (!= 1). An epic is done if all associated user stories are done.

I am trying to get a visual of the number of Epic done per project, for example a table (based on the previous example):

Project Epic done Total number of epic

 

P112
P211

 

I calculated the total number of US: total_us = COUNT(US)

and the number of US that are done total_done_us = CALCULATE( COUNT(US) , US Done = 1 )

And then i calculate the difference between total_done_us and total_us: Epic done = if(total_us - total_done_us =0, 1,0)

but it does not takes the epics into account, only the total of user stories.

 

I tried using a table or a matrix visual, but i do not success in having only the project name and the total of epic done per project and the total of epic per project.

1 ACCEPTED SOLUTION
bolfri
Super User
Super User

Total US = DISTINCTCOUNT(SampleData[US])
Total US - Done = CALCULATE([Total US],SampleData[US done] = 1)
Total Epic = DISTINCTCOUNT(SampleData[Epic])
Total Epic - Done = COUNTAX(FILTER(GROUPBY(SampleData,SampleData[Epic]),[Total US] = [Total US - Done]),1)

bolfri_0-1690933191433.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Chris_cons
New Member

Thanks Bolfri !

it works, i still have some work to understand some of the magical line:

Total Epic - Done = COUNTAX(FILTER(GROUPBY(SampleData,SampleData[Epic]),[Total US] = [Total US - Done]),1)

GROUPBY(SampleData,SampleData[Epic]) is same as DISTINCT(SampleData[Epic])

For each unique Epic check if Total US = Total US - Done. If yes, mark it as 1. 🙂 COUNTAX SUMs Epic by this 1. 





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

Proud to be a Super User!




bolfri
Super User
Super User

Total US = DISTINCTCOUNT(SampleData[US])
Total US - Done = CALCULATE([Total US],SampleData[US done] = 1)
Total Epic = DISTINCTCOUNT(SampleData[Epic])
Total Epic - Done = COUNTAX(FILTER(GROUPBY(SampleData,SampleData[Epic]),[Total US] = [Total US - Done]),1)

bolfri_0-1690933191433.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.