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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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