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.
I currently have a formula that I'm annualizing by multiplying by 12. However, to be more accurate I'd like to incorporate a "Days in Month / Days in Year" based off of the "TapeDate" that is in the data so that it's dynamic.
Current formula:
Solved! Go to Solution.
Hello @dashmarley11
Please try bellow measure and let me know if it worked the way you wanted to! 🙂
If it didn't work please share sample data or extra information.
Measure2 =
VAR CurrentDate = MAX('Deposits'[TapeDate])
VAR DaysInMonth = DAY(EOMONTH(CurrentDate, 0))
VAR DaysInYear = YEARFRAC(DATE(YEAR(CurrentDate), 1, 1), DATE(YEAR(CurrentDate), 12, 31)) * 365
VAR AdjustmentFactor = DaysInMonth / DaysInYear
RETURN
IFERROR((SUM('Deposits'[CLC_Withdrawal]) / SUM('Deposits'[AvgBook])) * AdjustmentFactor * 12, 0)
Hello @dashmarley11
Please try bellow measure and let me know if it worked the way you wanted to! 🙂
If it didn't work please share sample data or extra information.
Measure2 =
VAR CurrentDate = MAX('Deposits'[TapeDate])
VAR DaysInMonth = DAY(EOMONTH(CurrentDate, 0))
VAR DaysInYear = YEARFRAC(DATE(YEAR(CurrentDate), 1, 1), DATE(YEAR(CurrentDate), 12, 31)) * 365
VAR AdjustmentFactor = DaysInMonth / DaysInYear
RETURN
IFERROR((SUM('Deposits'[CLC_Withdrawal]) / SUM('Deposits'[AvgBook])) * AdjustmentFactor * 12, 0)
Hi @dashmarley11
Please check the below code. Assuming the year starts from 1st Jan and ends on 31st Dec. If not, please update the date in YearStart and YearEnd in the formula.
If not work, please share sample data in Excel format and post the expected result
Measure2 =
VAR CurrentDate = MAX('Deposits'[TapeDate])
VAR DaysInMonth = DAY(EOMONTH(CurrentDate, 0))
VAR YearStart = DATE(YEAR(CurrentDate), 1, 1)
VAR YearEnd = DATE(YEAR(CurrentDate), 12, 31)
VAR DaysInYear = COUNTROWS(DATES(YearStart, YearEnd))
RETURN
IFERROR(
(SUM('Deposits'[CLC_Withdrawal]) / SUM('Deposits'[AvgBook])) * (DaysInYear / DaysInMonth),
0
)
Proud to be a Super User! | |
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
181 | |
88 | |
71 | |
48 | |
46 |