Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Add a custom column to track the date

$
0
0

Hi Friends,

I have a exel file including itemcode,expireddate. Now i need to add a new column naming Expired_Days to calculate the number of days from today to the expired date for every item. But when i use the formula: 

Expired_Days = DATESBETWEEN(Sheet1[Expire Date],Sheet1[Expire Date],TODAY()) 

or 

Expired_Days = DATEDIFF(Sheet1[Expire Date].[Date],TODAY(),DAY)

i got an error as the startdate cannot be greater than enddate, because in expired date field containing both the date that > today() and the date <TOday()..

 

I hope to create a report to divide the number of expired days by 3 ranks like <30 days, 30 days<&& <60 days,>60 days...depend on the Expired_Days column by using the formula :

 

IF(Expired_DAys<0 then " Exprired"

ELSE IF(Expried_Day) < 30 then "Less than 30"

Else if (Expired_Day >30 and Expired_day<60) then " more than 30 and less than 60

else more than 60

 

the meeasre is Count(Itemcode)

 

This is formula i had in Tableau but i dont know how to do that in Power BI, Please help me to resolve it.

Thanks,
Michael.


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>