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.
Hi
How do i just take out the percentage from the list below in column 1. Thanks
Solved! Go to Solution.
Just modify the dax above:
Column = VAR v_PercentPos = SEARCH( "%", 'Table'[Data], 1, 0 ) VAR _var = TRIM( RIGHT( LEFT( 'Table'[Data], v_PercentPos ), 3 ) ) RETURN IF(_var = "00%", "100%", _var)
Or another way is to use python script:
# 'dataset' holds the input data for this script import pandas as pd dataset['Result'] = dataset['Data'].str.extract('\s(100%|(\d{1,2}(\.\d+)*)%)')[0]
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @WJ876400 ,
Try this:
Column = VAR v_PercentPos = SEARCH( "%", 'Table'[Field], 1, 0 ) RETURN TRIM( RIGHT( LEFT( 'Table'[Field], v_PercentPos ), 4 ) )
Thanks.
Please accept this as a solution if it satisfies the requirement. Appreciate your Kudos. 🙂
Hi @Anonymous
Thanks that worked apart from two rows i have ended up with an e and an m infront of the number
Just modify the dax above:
Column = VAR v_PercentPos = SEARCH( "%", 'Table'[Data], 1, 0 ) VAR _var = TRIM( RIGHT( LEFT( 'Table'[Data], v_PercentPos ), 3 ) ) RETURN IF(_var = "00%", "100%", _var)
Or another way is to use python script:
# 'dataset' holds the input data for this script import pandas as pd dataset['Result'] = dataset['Data'].str.extract('\s(100%|(\d{1,2}(\.\d+)*)%)')[0]
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |