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.
Good evening,
Could someone please help me with some nice clean DAX for each of the subsequent columns listed below?
Many thanks
Michelle
RAW
Split This
Just one value
Sometimes - I have two
And when I am - very lucky - then I can have three
And I can also - have a blank row - like in the above
Try these calculated columns:
Value 1 =
VAR _index1 = SEARCH("-", 'Table'[Split], 1, 0)
RETURN TRIM(IF(_index1 > 0, MID('Table'[Split], 1, _index1 - 1), 'Table'[Split]))
Value 2 =
VAR _index1 = SEARCH("-", 'Table'[Split], 1, 0)
VAR _index2 = IF(_index1 > 0, SEARCH("-", 'Table'[Split], _index1 + 1, LEN('Table'[Split]) +1), 0)
RETURN TRIM(IF(_index2 > 0, MID('Table'[Split], _index1 + 1, _index2 - _index1 - 1), BLANK()))
Value 3 =
VAR _index1 = SEARCH("-", 'Table'[Split], 1, 0)
VAR _index2 = IF(_index1 > 0, SEARCH("-", 'Table'[Split], _index1 + 1, 0), 0)
VAR _index3 = IF(_index2 > 0, SEARCH("-", 'Table'[Split], _index2, 0), 0)
RETURN TRIM(IF(_index3 > 0, MID('Table'[Split], _index2 + 1, LEN('Table'[Split]) - _index3), BLANK()))
Thankyou for your reply. Unfortunately I do not have the option of using power query. Only a calculated column via Dax
This is best done in Power Query. Just use the Split Column feature, By delimiter, and choose "-" as delimiter
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
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 |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |