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'd like to be able to create a measure showing the number of positive response divided by total number of rows. In example below should have about 55% (14/23). I thought of creating another column and putting if "positive", then 1, if not 0, then taking average, but figured there may be a simpler approach. Thanks.
Solved! Go to Solution.
Hi @jcastr02 ,
Here we go.
Measure =
VAR po =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', 'Table'[Sentiment] = "Positive" )
)
VAR countrall =
CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
RETURN
DIVIDE ( po, countrall )
Hi @jcastr02 ,
In your scenario, a measure like that can help you.
Measure =
VAR Technician =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
'Table',
'Table'[what is yuour role] IN { "Technician", "Pharmacist" }
)
)
RETURN
DIVIDE ( Technician, COUNTROWS ( 'Table' ) )
Pbix as attached.
Hi @jcastr02 ,
Here we go.
Measure =
VAR po =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', 'Table'[Sentiment] = "Positive" )
)
VAR countrall =
CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
RETURN
DIVIDE ( po, countrall )
How could I get it based on what filters are used, for example, when I filter for Location - "Miami" I see 26% , because its taking into account all surveys, not what is filtered by. I should see 75% , so 6/8 are positives from Miami. How can we alter the DAX? Thanks so much.
Which method do you use to identify if the value in a column is positive?
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
@zoloturu I don't use anything - This is calculated by microsoft Forms and just gives me responses based on text sentiment, I would just need to know the % of positives over total amount of surveys (rows)
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 |
---|---|
113 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |