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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.