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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
SAM_
New Member

Measure to have Multiple Countrows based on Conditions

 

Dear All,

 

I Created a Measure to get the total issues where Status is "Done" for Sprint="6" using below table for the measure

SprintCount =CALCULATE(COUNTROWS('Sheet1'),'Sheet1'[Sprint] = "Sprint6",'Sheet1'[Status] = "Done") and I am able to get the result too.
 
SnoIssuesStatusSprint
1768DoneSprint6
2888DoneSprint6
3666QA in ProgressSprint6
4999Deployed in ProdSprint6
5567DoneSprint5
6900DoneSprint5
7100In-ProgressSprint5

 

But when I use nestead CountRows as below I am unable to get the result 

SprintCount =CALCULATE(COUNTROWS('Sheet1'),'Sheet1'[Sprint] = "Sprint6",'Sheet1'[Status] = "Done") , COUNTROWS('Sheet1'),'Sheet1'[Sprint] = "Sprint5",'Sheet1'[Status] = "Done") .

 

Can any one please help me in knowing whats wrong in the above Measure for nestead Measure

 

Thanks & Regards,

SAM_

2 ACCEPTED SOLUTIONS

Hi @SAM_ 
Add Sprint column to the chart for bifurcation 
or
Create seperate measure for sprint5 condition and sprint 6 condition.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

Hi @SAM_ ,

 

I think  Uzi2019  's reply describes workaround but not detailed enough. I'll walk you through the exact process on my end.

According to your statement, I think you can try to add the [Sprint] column in X-axis and add below measure in Y-axis to create a clustered column chart.

Measure:

SprintCount = CALCULATE(COUNTROWS('Sheet1'),'Sheet1'[Status] = "Done")

Result is as below.

vrzhoumsft_0-1713257820949.png

 

Best Regards,
Rico Zhou

 

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

 

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@SAM_ Try this:

SprintCount =
COUNTROWS(FILTER('Sheet1', [Sprint] = "Sprint6" && [Status] = "Done") 
+
COUNTROWS(FILTER('Sheet1', [Sprint] = "Sprint5" && [Status] = "Done") 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  Thanks for rapid response .

I would like to have 2 results in 1 measure , But not summing it . As you can see there is stacked chart for sprint6 for measure  SprintCount =CALCULATE(COUNTROWS('Sheet1'),'Sheet1'[Sprint] = "Sprint6",'Sheet1'[Status] = "Done"and beside it I want to have result of Sprint 5 in same chart for comparision.

 

SAM__0-1712107563721.png

 

Hi @SAM_ ,

 

I think  Uzi2019  's reply describes workaround but not detailed enough. I'll walk you through the exact process on my end.

According to your statement, I think you can try to add the [Sprint] column in X-axis and add below measure in Y-axis to create a clustered column chart.

Measure:

SprintCount = CALCULATE(COUNTROWS('Sheet1'),'Sheet1'[Status] = "Done")

Result is as below.

vrzhoumsft_0-1713257820949.png

 

Best Regards,
Rico Zhou

 

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

 

Hi @SAM_ 
Add Sprint column to the chart for bifurcation 
or
Create seperate measure for sprint5 condition and sprint 6 condition.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.