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.
Hello everyone,
I had a dataset in powerBI, where it looks as follows
Numbers | Exams |
1 | DAX-100-PowerBI-2018-2021 |
2 | 20-DAX-200-PowerBI-2021 |
3 | 201-DAX-205-powerBI-2019-2020 |
Numbers | Exams | Years |
1 | DAX-100-PowerBI-2018-2021 | 2018-2021 |
2 | 20-DAX-200-PowerBI-2021 | 2021 |
3 | 201-DAX-205-powerBI-2019-2020 | 2019-2020 |
Solved! Go to Solution.
Hi, @Anonymous
According to your description, I can clearly understand your requirement, you can try to create a calculated column like this:
Years =
IF(
ISERROR(left(RIGHT([Exams],6),1)+1),
RIGHT([Exams],4),
RIGHT([Exams],9))
And you can get what you want, like this:
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, I can clearly understand your requirement, you can try to create a calculated column like this:
Years =
IF(
ISERROR(left(RIGHT([Exams],6),1)+1),
RIGHT([Exams],4),
RIGHT([Exams],9))
And you can get what you want, like this:
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , a new column in DAX
Year =
var _pos = search("PowerBI-",[Col],,0)
return
right([Column], len([Column] -(_pos+8))
Hi Amit,
sorry, I didn't get what that mean - could you please elaborate the measure and the measure says that we are searching "PowerBI-". But in my case I will have two different types of text either "PowerBI" or "Power flow".
Thanks Amit.
@Anonymous , I try to get the location of - after power bi and use that.
What you do first check if it has power bi or power flow and the change logic .
ALso this a new measure
Year =
var _pos = search("PowerBI-",[Col],,0)
return
if(_pos>0, right([Column], len([Column] -(_pos+8)), right([Column], len([Column] -(_pos+11)) )
Hi Amit
I am getting an syntax error.
Thank you so much for following up the error.
Really appreciated-
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |