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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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