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.
I've looked at many similar suggested strings but since I'm new to Powr BI and DAX, I'm having a hard time translating the solutions into what I need.
I have a columns labled "Emotional Depression" and in that column will be "Depression" if the client checked a box saying they were having a hard time with depression. So each row in that column will either be blank, or have the word "Depression". (A little strange data set I know, but I used the data to assist with writing a note.)
Eventually I would like to make a pie chart with the numbers because I have four Emotional columns but I can't even get out of the gate with getting a usable number.
I assume I need to create a measure, but can't get the DAX correct (if that's even the correct way to go).
Thanks for any insight.
Solved! Go to Solution.
you could also (as just realised that the column would only contain this word or nothing)
ContainsDepression=
IF([Emotional Depression] = "Depression",1, 0)
You can create a measure using this formula:
# Depression = CALCULATE(COUNTAX('TableName','TableName'[Emotional Depression]),'TableName'[Emotional Depression]="Depression")
Everytime you update your feed, it will update the count.
Edit: Forgot the apostrophes.
Thanks, I'll give that one a try too1
Thanks for you quick and accurate reply Dog. I appreciage the help!!
Mark
Hi @MarkHansen
I suppose an easy way through DAX is to create a calculate column first off which checks if it can find the word depression in the column. I use "SEARCH" because it's not case sensitive.
ContainsDepression=
var IsFound = SEARCH("Depression", [Emotional Depression], ,0)
RETURN
IF(IsFound = 0, 0, 1)
you can then create a new measure that simply counts up these values.
DepressionRows:=Calculate(sum([ContainsDepression]))
not sure if this helps or not?
Dog
you could also (as just realised that the column would only contain this word or nothing)
ContainsDepression=
IF([Emotional Depression] = "Depression",1, 0)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |