Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello!
I'm starting to learn DAX but running into issues where I need to create measures based on STRING values. For example:
I need to count the number of occurances of the string "FTA" (Failure To Appear) in the Court Hearing Result column between a specified date starting and ending date range.
IN addidtion, I then need to make another meausre off of that expressing the percentages of FTA results based on the Total COUNT of hearings in that data range.
Can someone help me with these DAX formulas?
Thank you!
Solved! Go to Solution.
@Kevykev Create a calculated column:
HasFTA := IF (Find("FTA",[Court Hearing Result],1,-1) = -1, 0, 1)
Create a new measure as FTACount = SUM([HasFTA]) in the same table where you created a new column "HasFTA"
Then a TotalRecords = CALCULATE(COUNTROWS(TABLE),ALL)
Percentages would be FTA% = [FTACount]/[TotalRecords]
@Kevykev ,
YOu can create a measure based on string condition using FILTER DAX. Please follow the below DAX meausre to get your output:
Thank you very much. This helps me greatly be getting an example that I can now see applied to my data model and business use case!
Thank you very much. This helps me greatly be getting an example that I can now see applied to my data model and business use case!
@Kevykev ,
YOu can create a measure based on string condition using FILTER DAX. Please follow the below DAX meausre to get your output:
Thank you very much. This helps me greatly be getting an example that I can now see applied to my data model and business use case!
@Kevykev Create a calculated column:
HasFTA := IF (Find("FTA",[Court Hearing Result],1,-1) = -1, 0, 1)
Create a new measure as FTACount = SUM([HasFTA]) in the same table where you created a new column "HasFTA"
Then a TotalRecords = CALCULATE(COUNTROWS(TABLE),ALL)
Percentages would be FTA% = [FTACount]/[TotalRecords]
Thank you very much. This helps me greatly be getting an example that I can now see applied to my data model and business use case!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
89 | |
52 | |
45 | |
39 | |
38 |