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 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.
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |