Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
adoalan
Helper III
Helper III

TRIM the data from a measure

Hi

 

I have this forumla to trim the data but I have one item which I still need to remove '-U'.

 

How can I include that in the same formula let's say to trim also the data where '-U' is identified.

 

Only measure please because I cannot import all tables in Power BI and use custom columns and power query.

 

adoalan_0-1680098072365.png

 

adoalan_3-1680098138804.png

 

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

Hi @adoalan 

 

Change the RETURN statement to this

 

RETURN SUBSTITUTE(MID(EvalString, 1, LenTo), "-U", "")

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

Hi @adoalan 

 

The 2nd image shows that you have many different Codes in your table, so when you are only seeing 1 row when the Final 1 measure isn't included, this may be because of some other filtering or aggregation on that visual.

 

The measure isn't duplicating data, that data is there, it's just not shown in your first visual.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
adoalan
Helper III
Helper III

@PhilipTreacy 

Actually there is an error. Instead of getting one line like below

adoalan_0-1680166085561.png

 

I get this

 

adoalan_1-1680166100076.png

 

When I remove the formula

adoalan_2-1680166127030.png

 

Is giving the correct results.

 

Any idea how to fix this issue?

 

Thanks

 

 

Hi @adoalan 

 

Sorry I'm not seeing what the problem is.  What do you want as the result?

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

The result should be just one line in the example which I posted below But somehow the formula is duplicating some values.

 

For example if I put a filter on ADDC06-01/002-UK

 

adoalan_0-1680167678743.png

 

On the report without formula added I get only one line eith the amount of 63.

adoalan_1-1680167704575.png

 

But when I drag the formula in I see all those with different Codes, the same sourcecode and the same amount

adoalan_2-1680167766579.png

Let me know if makes sense

 

Thank you

Hi @adoalan 

 

The 2nd image shows that you have many different Codes in your table, so when you are only seeing 1 row when the Final 1 measure isn't included, this may be because of some other filtering or aggregation on that visual.

 

The measure isn't duplicating data, that data is there, it's just not shown in your first visual.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @adoalan 

 

Change the RETURN statement to this

 

RETURN SUBSTITUTE(MID(EvalString, 1, LenTo), "-U", "")

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thank you @PhilipTreacy 

 

Worked perfectly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.