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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Count measures that contains "A"

I have a following visual.

 

customers  measure 1  measure 2  measure 3  count "A" measure
01ABC1
02AAB2
03CBC0
04ACA2
05AAA3

 

 

how to create a measure to count the number of "A" in measure 1, 2 and 3.

 

Kind regards

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try

Count A =
VAR M1 = IF([Measure 1] = "A", 1)
VAR M2 = IF([Measure 2] = "A", 1)
VAR M3 = IF([Measure 3] = "A", 1)
RETURN
M1 + M2 + M3




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

5 REPLIES 5
PaulDBrown
Community Champion
Community Champion

Try

Count A =
VAR M1 = IF([Measure 1] = "A", 1)
VAR M2 = IF([Measure 2] = "A", 1)
VAR M3 = IF([Measure 3] = "A", 1)
RETURN
M1 + M2 + M3




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

perfect thank you!!

Tutu_in_YYC
Resident Rockstar
Resident Rockstar

What are the DAX measures for measure 1, 2 and 3?

Anonymous
Not applicable

They are IF measures to group customers based on some condistions, for example meaure 1 is 

ordered days Group = IF([ordered days Running Total]/[count days total] < 0.7, "A",IF([ordered days Running Total]/[count days total] >= 0.7 && [ordered days Running Total]/[count days total] < 0.9, "B", "C"))

and the other two measures are the same just different conditions.

Samarth_18
Community Champion
Community Champion

HI @Anonymous ,

 

Please try this:-

Measure  = COUNTROWS(FILTER('Table (6)',CONTAINSSTRING([Measure 1], "A") || CONTAINSSTRING([Measure 2], "A") || CONTAINSSTRING([Measure 3], "A")))

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.