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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Mederic
Post Patron
Post Patron

Extract dates and numbers

Hello everyone,

I would like to get the result in the screenshot below without using the "Column From Examples" option
Thanks in advance for your help

Regards

 

Date Number.jpg

 

Value

>01/07/2023
And > 31/08/2023
<01/10/2022
And <01/04/2023
<=2500 €
<01/05/2023
And <01/01/2023
And >5000 €
<01/01/2023
And <0
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Mederic 

 

Download example PBIX file

 

This query will give you the desired result

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBONTDUNzDXNzIwMlaK1YlWcsxLUYBIKBgDZSwQMmDRZKByQwOQoBGqcpCEgQm6alsjUwMDhUdNa1BNMDDFYiFYwhCbS4BmYDMEm9pkA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each if Text.PositionOf([Value], "/") >= 0 then Text.Select([Value], {"0".."9", "/"}) else null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Amount", each if Text.PositionOf([Value], "/") = -1 then Text.Select([Value], {"0".."9"}) else null),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Date", type date}, {"Amount", Int64.Type}})
in
    #"Changed Type1"

 

 

ts.png

 

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

2 REPLIES 2
Mederic
Post Patron
Post Patron

Hello @PhilipTreacy 

Thanks very much, it's perfect 😊
Have a nice day

PhilipTreacy
Super User
Super User

Hi @Mederic 

 

Download example PBIX file

 

This query will give you the desired result

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBONTDUNzDXNzIwMlaK1YlWcsxLUYBIKBgDZSwQMmDRZKByQwOQoBGqcpCEgQm6alsjUwMDhUdNa1BNMDDFYiFYwhCbS4BmYDMEm9pkA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each if Text.PositionOf([Value], "/") >= 0 then Text.Select([Value], {"0".."9", "/"}) else null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Amount", each if Text.PositionOf([Value], "/") = -1 then Text.Select([Value], {"0".."9"}) else null),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Date", type date}, {"Amount", Int64.Type}})
in
    #"Changed Type1"

 

 

ts.png

 

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!


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors