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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Not been sold last 2 years

Hello

 

So i have 2 diferent date columns

Im trying to figure out how to calculate, how mutch each warehouse has in stock hasent been sold the last 2 years. But not count those who has a creation date 2 years from todays date . Meaning im trying to find how mutch obsolencence mearchandise each warehouse have.

Example:

Eksempel bilde.png

 

 

 

3 REPLIES 3
Anonymous
Not applicable

Right click on your table name and select "New column", then enter the following:

 

Over 2 years old = if(table[Last sold date]-table[Creation date] > 730, "Y","N")

 

substitute "table" with your actual table name.

 

Now, you will have a column telling you "Y" if there are 730 days between the two dates and a "N" if not.  Pull this column into your "Visual level filters" and select Y to see only items that are 2 years or older.

 

There are people on here a lot smarter than me so there might be a better way but this is how I would do it.

Anonymous
Not applicable

Hi and thank you Usates

However im getting this error with the formula

1234.png

Anonymous
Not applicable

You need a comma instead of a colon in between the "Y" and "N"

 

.........> 730, "Y","N")

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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