Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I am trying to identify all rows of data that contain certain values within a text string on 2 diferent fields:
have I used the wrong function here?
Is there a better way to find a text string to help me identify the right deals - both date fields are "text" format and I can't transform it.
many thanks Jo
Solved! Go to Solution.
Technically yes you can but better to convert to text data type like
Jan 2024 deal =
IF (
ISEMPTY (
FILTER (
'ICISCreativeTrack Targeting2023',
AND (
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[End_Date], "2023-12-31" ),
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[Start_Date], "2022-" )
)
)
),
"No",
"Yes"
)
you may also use it as a count or visual level filter Like in
Jan 2024 deal =
COUNTROWS (
FILTER (
'ICISCreativeTrack Targeting2023',
AND (
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[End_Date], "2023-12-31" ),
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[Start_Date], "2022-" )
)
)
)
Hi @BlandJ
Please try
Jan 2024 deal =
NOT ISEMPTY (
FILTER (
'ICISCreativeTrack Targeting2023',
AND (
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[End_Date], "2023-12-31" ),
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[Start_Date], "2022-" )
)
)
)
That's works nicely - can I use this result in a visual? It seems ot only want to bring it through as a value not a row or column header.... do I need extra stuff in here to return a value of Y or N if it's true or false? I'm slowly getting to grips with DAX code but this one is eluding me! Many thanks Jo
Technically yes you can but better to convert to text data type like
Jan 2024 deal =
IF (
ISEMPTY (
FILTER (
'ICISCreativeTrack Targeting2023',
AND (
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[End_Date], "2023-12-31" ),
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[Start_Date], "2022-" )
)
)
),
"No",
"Yes"
)
you may also use it as a count or visual level filter Like in
Jan 2024 deal =
COUNTROWS (
FILTER (
'ICISCreativeTrack Targeting2023',
AND (
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[End_Date], "2023-12-31" ),
CONTAINSSTRING ( 'ICISCreativeTrack Targeting2023'[Start_Date], "2022-" )
)
)
)
thank you!
It's way better but I now get this error: A single value for column 'End_Date' in table 'ICISCreativeTrack Targeting2023' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, coun
The data looks like this:
hi @BlandJ
try like:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |