Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
alek483
Regular Visitor

Create measure for calculating rows that contain string

I use this to calculate rows with Parkert kasseekspedisjon:

Antall manuell rabatt = CALCULATE(COUNTROWS(KasseJournal),KasseJournal[Hendelse] = "Parkert kasseekspedisjon") + 0
 
But I need to be able to calculate rows with different strings. The string always contains "Manuell rabatt endret".
In excel I can use wildcard, but how can I do this in dax?
1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Do you mean you wnat to calculate the count of strings which contain ""Manuell rabatt endret"?
You can use CONTAINSSTRING(KasseJournal[Hendelse], "Manuell rabatt endret")
Docs here: https://learn.microsoft.com/en-us/dax/containsstring-function-dax

View solution in original post

2 REPLIES 2
alek483
Regular Visitor

Thanks, this worked.
Antall manuell rabatt = CALCULATE(COUNTX(KasseJournal,KasseJournal[Brukernavn]),FILTER(KasseJournal,CONTAINSSTRING(KasseJournal[Hendelse],"Manuell rabatt endret") = TRUE())) + 0
vicky_
Super User
Super User

Do you mean you wnat to calculate the count of strings which contain ""Manuell rabatt endret"?
You can use CONTAINSSTRING(KasseJournal[Hendelse], "Manuell rabatt endret")
Docs here: https://learn.microsoft.com/en-us/dax/containsstring-function-dax

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.