The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I would like to calculate years between two date columns, one is "StartDate" and the other "EndDate".
EndDate has blanks and I would like to use a specific date as blank substitute: "2016-12-31"
I know it is something like: IF( ISBLANK( in combination with DATEDIFF but I can't figure out how to write it.
Thank you!
Solved! Go to Solution.
@Anonymous Try:
Column = IF([EndDate] = BLANK(),DATEDFF([StartDate],DATE(2016,12,31)),DATEDIFF([StartDate],[EndDate]))
@Anonymous Try:
Column = IF([EndDate] = BLANK(),DATEDFF([StartDate],DATE(2016,12,31)),DATEDIFF([StartDate],[EndDate]))
Thank you very much! It worked perfect with interval argument as YEAR.
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |