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
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
Solution Sage
Solution Sage

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
Solution Sage
Solution Sage

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
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.