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 i have a data table with following where i have a lot of entries like:
ENTRY | PART OF ENTRY WHICH DEFINES TYPE |
AAHEPX | XXXPX |
DKDEFX | XXXFX |
5DKDKE | 5XXXX |
6EOEEM | 6XXXX |
7ENEEG | 7XXXX |
S2OLDC | S2OLDC |
My translation table needs to be able to be able to decode the data with both full, Left and Right functions.
In SAP i use If(Substr(Trim([ENTRY]);4;2))="PX") Then "Public export", and then add RIGHT/LEFT functions for every type without a translation table.
Could i build a tranlations table in Power BI which would better or is IF(RIGHT/LEFT the only way to solve it?
Solved! Go to Solution.
Hi @bilingual ,
Column = SWITCH(
TRUE(),
SEARCH("FX",'Table20'[ENTRY],1,0) > 0 , "Public Export",
SEARCH("7",'Table20'[ENTRY],1,0) > 0 , "Local Export",
SEARCH("S2OLDC",'Table20'[ENTRY],1,0) > 0 , "Special Export"
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi again, so sorry, can see it is not very clear writtten, i try again with an example, how it is working in SAP:
ENTRY | PART OF ENTRY WHICH DEFINES TYPE | TYPE DEFINED FROM PART OF ENTRY | CURRENT SAP FORMULA |
DKDEFX | "FX" | Public export | =If(Substr(Trim([ENTRY]);4;2))="PX") Then "Public export" |
7ENEEG | "7" | Local export | =If(Substr(Trim([ENTRY]);1;1))="7") Then "Local export" |
S2OLDC | S2OLDC | Special export | =If(Substr(Trim([ENTRY]);1;6))="S2OLDC") Then "Special export" |
All entries have a length of 6 characters
Hi @bilingual ,
You will need SEARCH ,MID, LEFT functions to extract the value.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @bilingual ,
Column = SWITCH(
TRUE(),
SEARCH("FX",'Table20'[ENTRY],1,0) > 0 , "Public Export",
SEARCH("7",'Table20'[ENTRY],1,0) > 0 , "Local Export",
SEARCH("S2OLDC",'Table20'[ENTRY],1,0) > 0 , "Special Export"
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi, very quick question, will it be better to use RIGHT, MID or LEFT in terms of memory compared to SEARCH, when i know the position of each variable?
HI @bilingual
Thank you for more detail.
You can try SEARCH()
https://docs.microsoft.com/en-us/dax/search-function-dax
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
HI @bilingual
Thank you for more detail.
Can you try SEARCH()
https://docs.microsoft.com/en-us/dax/search-function-dax
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@bilingual , Not very clear
In DAX
If(MID(Trim([ENTRY]),4,2)="PX" , "Public export",blank())
in Power Query M
if Text.Middle(Text.Trim([ENTRY]),4,2)="PX" then "Public export"
Hi @bilingual ,
You can use FIND,SEARCH function and a combine them with LEFT ,RIGHT and MID Function in Power BI.
Can you share some sample data and expected output.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
HI @bilingual
Not very clear.
Can you please post sample output or all SAP condition for each row.
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
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 |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
82 | |
67 | |
61 | |
46 | |
45 |