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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors