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.
Solved! Go to Solution.
Hi @scabezas ,
It's easy to complete it. Try
Total count = SUMX(ALL('Table'),[Measure])
You can view the details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @scabezas ,
The principle is to delete CR-APPROVED and calculate the difference between the two strings. This difference divided by the length of CR-APPROVED is the result. And it works in live connection.
Try this measure
Measure = var _len=LEN(MAX('Table'[Change reques approvals]))
var _len1=LEN(SUBSTITUTE(MAX('Table'[Change reques approvals]),"CR-APPROVED",""))
RETURN DIVIDE( _len-_len1,LEN("CR-APPROVED"))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Stephen Tao, thank you for taking the time to respond and add the PIBIX file, that helps a lot. I updated the PIBIX file to include a second table with 3 records where the Redirection Comments field includes actual data and where the count of of instances in each record for the key word PCR-APPROVED is 2 and the goal is to report the total count; in this case, would be 6; however the measure in your proposed solution returns a count of 2 as shown in the card and table totals. Is there a way to get the total count expected of 6 instances?
I do not see an option to upload the updated PIBIX for reference
Hi @scabezas ,
It's easy to complete it. Try
Total count = SUMX(ALL('Table'),[Measure])
You can view the details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-stephen-msft Thank you so much for the solution. The PIBIX with the actual solution helps greatly. I have implemented the solution and is working like a charm
Simple enough in Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlHwS8xNVdJRCi5Nys0sKUlNiclzDtJ1LCgoyi8DcZDEPfMUnDNSk7NRVCjFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, Process = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", type text}, {"Process", type text}}),
Count = Table.AddColumn(#"Changed Type", "Occurrence", each List.Count(Text.PositionOf([Process], "cr-approved", Occurrence.All, Comparer.OrdinalIgnoreCase)))
in
Count
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hey @scabezas ,
you can solve that with SUMX and CONTAINSSTRING:
Amount Approved =
SUMX(
myTable,
IF(
CONTAINSSTRING(
myTable[Change Requests Approvals],
"APPROVED"
),
1,
BLANK()
)
)
Hi Denis, thank you for your response. I tried your suggested solution but does not give me the total expected number of instances for this field. The screenshot belows shows the measure (PCR-APPROVED Count) returns a count of 1 for each record where it should be 2 and the card shous the total unique instanes of 3 when it is expected to be 6. Is there a way to loop within a field to increase the instance count so that for each record in this screenshot would return 2 and therefore the card would total to 6?
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 |
---|---|
102 | |
101 | |
87 | |
73 | |
67 |
User | Count |
---|---|
116 | |
109 | |
94 | |
79 | |
72 |