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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jgni
Frequent Visitor

How do I visualize only data which is never than yesterday?

Hi

 

Newbie here. I don't if it's smartest to do this in the web version or desktop. So I put my question here...

 

I have an Excel sheet, which contains a date field, and I only want to show the rows, if they're end date in 'End' are after yesterday.

How to?

 

SprintDev. board-mødeKick OffStartEndKommentar
2814 nov25 nov15 dec18 decInklusiv juleferie
2905 dec09 dec19 jan08 feb 
3019 dec22 dec09 feb08 marInklusiv vinterferie
3130 jan03 feb09 mar29 mar 
3220 feb28 feb30 mar19 aprInklusiv påskeferie
Regards
Jan
6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @jgni,

 

I'd like to suggest you add a filter at query editor side ("today" as the parameter).

 

For example:

 

FilterRows = Table.SelectRows(#"Name of Previous Step", each [Date] >= DateTime.LocalNow())

 

Reference link:

Power Query Current Date Filter

 

 

Regards,
Xioaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I'm still a newbie in PBI.

 

How do I add a filter?

In Excel or Power BI - Query Editor? And if the latter, then how?

 

Regarfs

Jan

 

Regards
Jan

Hi @jgni,

 

You can take a look at below steps:

 

1. Open the query editor.

2. Find out the last steps of your query.

3. Click on fx button to add steps.

4. Modify the formula with above steps name.

 

Full query:

 

let
    Source = Excel.Workbook(File.Contents("C:\Users\xxxx\Desktop\sampel.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"End", type date}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] = Date.AddDays(DateTime.LocalNow(),-1))
in
    #"Filtered Rows"

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi

 

This gives me 4 rows:   #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] >= #date(2017, 3, 7))

 

But this gives me 0: #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] = Date.AddDays(DateTime.LocalNow(),-1))

 

??

 

Regards

Jan

Regards
Jan

Hi @jgni,

 

This gives me 4 rows:   #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] >= #date(2017, 3, 7))

But this gives me 0: #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] = Date.AddDays(DateTime.LocalNow(),-1))


The first one will get the records which date large than yesterday, the second one only get the equal data. If your requirement is filter data like first one, you can try to use below formula to make it dynamic get current date.

 

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [End] >= Date.From(Date.AddDays(DateTime.LocalNow(),-1)))

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you! I'll try that.....

 

Regards
Jan

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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