Forum Discussion
Anonymous
3 years agoNot applicable
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?
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
2 Replies
- vicky_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 - AnonymousNot applicableThanks, this worked.Antall manuell rabatt = CALCULATE(COUNTX(KasseJournal,KasseJournal[Brukernavn]),FILTER(KasseJournal,CONTAINSSTRING(KasseJournal[Hendelse],"Manuell rabatt endret") = TRUE())) + 0