Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a single table with a column containing percentage values and I want to count the number of values greater than 50%
How do I achieve that?
Solved! Go to Solution.
Hi dmutua,
We can't compare numberic value to text value, so you could try to convert data type to Decimal number , then use above count measure, or you could create a colum like below, extract whole number and convert this as Whole number, then use count measure.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlLSUTI0MFBVitWJVkoGcsCMFCADSczIGMiOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, p = _t]), #"Inserted Text Before Delimiter" = Table.AddColumn(Source, "Text Before Delimiter", each Text.BeforeDelimiter([p], "%"), type text), #"Changed Type" = Table.TransformColumnTypes(#"Inserted Text Before Delimiter",{{"Text Before Delimiter", Int64.Type}}) in #"Changed Type"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please try
Calculate(countrows(table1),value>50) OR Calculate(countrows(table1),value>.50)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it at Solution.
Thanks.
Hi,
Thank you,the column I am trying to count is formatted as text because it has whole number and som text values.
What are my options in performing a countrows function on a text formatted column?
Thanks
Hi dmutua,
We can't compare numberic value to text value, so you could try to convert data type to Decimal number , then use above count measure, or you could create a colum like below, extract whole number and convert this as Whole number, then use count measure.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlLSUTI0MFBVitWJVkoGcsCMFCADSczIGMiOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, p = _t]), #"Inserted Text Before Delimiter" = Table.AddColumn(Source, "Text Before Delimiter", each Text.BeforeDelimiter([p], "%"), type text), #"Changed Type" = Table.TransformColumnTypes(#"Inserted Text Before Delimiter",{{"Text Before Delimiter", Int64.Type}}) in #"Changed Type"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |