cancel
Showing results for 
Search instead for 
Did you mean: 
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_
Solution Supplier
Solution Supplier

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_
Solution Supplier
Solution Supplier

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.