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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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_

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") 

@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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