Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I have 2 columns that I want to use here:
1. Comments: This is a text column where people have either put in a comment or left it blank.
2. Sentiment: This is also a text column with 4 possible values (Positive, Negative, Neutral, and NA)
I want to get the % of each sentiment type for all the non-blank comments.
I.e. (Count of Sentiment Type/Non-Blank comments)*100
I have used the following measures:
1. Total Comments = CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] <> BLANK())
On using this in a card visual it gives me the right value. I.e. 3675 non-blank comments.
2. Dynamic Sem Sentiment = DIVIDE(COUNTROWS(Table1), 3675)
Using this when I have hard coded the denominator gives me the right result (see screenshot 1).
But if I update the measure to make it dynamic I.e
If I understand the requirement correctly, it's like this:
Dynamic Sem Sentiment = DIVIDE(
CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] <> BLANK())
,CALCULATE(COUNTROWS(Table1),ALL(Table1[Sentiment]), Table1[Calendar Comments] <> BLANK())
)
Hi @KandiBawa ,
I think you can update [Total Comments] measure as below.
Total Comments =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( ALLSELECTED ( Table1 ), Table1[Calendar Comments] <> BLANK () )
)
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.
@KandiBawa Hi! Try with a one single measure:
Dynamic Sem Sentiment =
VAR TotalNonBlankComments = CALCULATE(COUNTROWS(Table1), Table1[Calendar Comments] <> BLANK())
RETURN
DIVIDE(COUNTROWS(Table1), TotalNonBlankComments)
BBF
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |