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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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