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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
DB_CJC
New Member

Filtering Report tabels with date requirement/ data cleaning

Dear all,

 

1st resquest for support:

ich would like to display on my dashboard a table which is listing future changes. The table content was been created by drag and drop operations and calculations.

Currently the table is listing all available information, i would like to filter in the following manner:

(a) only rows shall be listed which have an entry in colum "target availability date"

(b) only rows shall be listed where the target availability date is higher than the beginning of last month

 

2nd request for support:

unfortunalty the entries in colum "target availability date" are not entered in the same structure. entries can look as follows:

(a) 01.01.2023

(b) 01/23

(c) tbc (2023)

(d) cw37/23

(e) 01/2023

(f) 01.10.2022 (tbc)

 

In order to have a good filtering result for request #1 i thought it might be helpful to transfer all availble date types into one common date format (ideally 01.01.2023). Do you have an idea by which function this might be avieved?

 

I would like to achive the entries may look als follows:

(a) 01.01.2023        --> leave as it is

(b) 01/23                --> transfer to 01.01.2023

(c) tbc (2023)          --> transfer to 01.01.2023

(d) cw37/23            --> trasnfer to 11.09.2023

(e) 02/2023             --> transfer to 01.02.2023

(f) 01.10.2023 (tbc) --> transfer to 01.10.2023

 

The data table looks as follows:

 

Part NameIAL part numberinternal part numbertarget availability datePPAP stats
part A123456556633-0101.02.2023G

part B

654321445533-0237/23Y
part C145236225566-05tbcG
part D365214223344-0102/2023R

 

Thanks alot for the support.

 

@v-luwang-msfti will continue the support request by this post.

 

With the following link i'll provide a sample file

https://www.dropbox.com/s/3d7xuxvsint4rpl/Sample_MSforum.pbix?dl=0

 

Thanks and best regards

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Ideally this unclean data would not even make it into Power BI.  Anyway, I would recommend against attempting to do this in DAX. Here is a framework of how to do it in Power Query.  I'll leave the calendar week gymnastics up to you

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUMzDSMzIwMlKK1YFwjVG5JqhcC1SuJQrX0AAbV0GjJClZEyxoaKAPVwBlK2iEODlDZQ2RZI2Q2BZ6BqYIk5PLjc31oWygyQoaQBljiAlGpgiVsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Target Availability Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Target Availability Date", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each 
try Date.From([Target Availability Date],"de-de")
otherwise try Date.From(Text.Start([Target Availability Date],10),"de-de")
otherwise try Date.From(Text.Start([Target Availability Date],8),"de-de")
otherwise try Date.From(Text.Range([Target Availability Date],5,4),"de-de")
otherwise null
,type date)
in
    #"Added Custom"

 

Please note that Power Query is case sensitive.

 

lbendlin_0-1671319617866.png

 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Ideally this unclean data would not even make it into Power BI.  Anyway, I would recommend against attempting to do this in DAX. Here is a framework of how to do it in Power Query.  I'll leave the calendar week gymnastics up to you

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUMzDSMzIwMlKK1YFwjVG5JqhcC1SuJQrX0AAbV0GjJClZEyxoaKAPVwBlK2iEODlDZQ2RZI2Q2BZ6BqYIk5PLjc31oWygyQoaQBljiAlGpgiVsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Target Availability Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Target Availability Date", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each 
try Date.From([Target Availability Date],"de-de")
otherwise try Date.From(Text.Start([Target Availability Date],10),"de-de")
otherwise try Date.From(Text.Start([Target Availability Date],8),"de-de")
otherwise try Date.From(Text.Range([Target Availability Date],5,4),"de-de")
otherwise null
,type date)
in
    #"Added Custom"

 

Please note that Power Query is case sensitive.

 

lbendlin_0-1671319617866.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Solution Authors