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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ebo01
Regular Visitor

Create MEASURE to calculate % of Rows that have the correct Regex format for Organisation number

I have these two columns:
'prod EIP_big_table'[company_number]
'prod EIP_big_table'[country_code]

I also have the regex expression for a DK organisation number:
^(?:\d{2}\s?\d{2}\s?\d{2}\s?\d{2}|\d{8})$


I would like help to create a MEASURE that looks through all rows in prod EIP_big_table where the 'prod EIP_big_table'[country_code] is equal to DK.
In those rows i wish to compare the 'prod EIP_big_table'[company_number] with the regex expression to see if it is correct or not.

Then I wish to return the % of DK rows that have the correct format for organisation number.
Is this possible?

Regards /Emma

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @ebo01 

Unfortunately, Power BI's DAX language itself does not support regular expressions, so it is not possible to use regular expression patterns directly in DAX metrics. If you want to implement similar queries, you can do so with the help of the new Visual.

vyaningymsft_0-1714963582862.png

Get Text search slicer.

vyaningymsft_1-1714963774557.png

vyaningymsft_2-1714964037792.png

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-yaningy-msft
Community Support
Community Support

Hi, @ebo01 

Unfortunately, Power BI's DAX language itself does not support regular expressions, so it is not possible to use regular expression patterns directly in DAX metrics. If you want to implement similar queries, you can do so with the help of the new Visual.

vyaningymsft_0-1714963582862.png

Get Text search slicer.

vyaningymsft_1-1714963774557.png

vyaningymsft_2-1714964037792.png

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.