The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi, I just started with Power BI and I tried to figure this out by myself, but I didn't find a solution yet, so I hope you can help me or show mit the thread I overlooked. Thanks in advance!
I have to calculate the Age of a Wineyard. The Year in which the Wineyard was bed out is just a Year in a Table like 1988.
In another Table I have a Date collum with a date for every action. Like Date <1.5.2015> action <mulch> or date <10.10.2015> action <harvest> and so on.
when I set a filter on 2015 I need the difference in years between the filter and the year the wineyard was bed out.
never mind...
I haven't been sure, If the problem is that there are different dates in the form dd.mm.yyyy so I created a calculated collum:
year_solo = year(Pivot[date])
then i created this measure:
age= datediff(min('Schläge'[year1]);min(Pivot[year_solo]);DAY)
I still have no clue, why I have to use DAY, but thats why It hasn't been working 😉
Hi @herbemischung,
Based on this official article, when using DATEDIFF function, we should specify scalar datetime value as start_date .
DATEDIFF(<start_date>, <end_date>, <interval>)
In your scenario, 'Schläge'[year1] column contains numeric value rather than datetime value, you would need to use the following formula to calculate age.
age= min('Schläge'[year1])- min(Pivot[year_solo])
Thanks,
Lydia Zhang
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |