Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I wish to add a calculated column in my PowerBI report, which calculates the hours saved based on the date provided and hourly savings up until todays date. The only caveat is that I only need the hours to be calculated for 2018.
We have a Sharepoint list, which has columns for "start date" and monthly savings (in hours). However we have projects which go back a few years, which I do not wish to include.
The DAX I have for the project run time is:
Project Run Time = IF('LEANSavings '[OccurenceValue] = "Re-Occurring Savings", (TODAY() - 'LEANSavings '[SavingsStartDate].[Date])/30, 1)
I wish to add something to state that if
LEANSavings '[SavingsStartDate].[Date]
is before 1/1/2018, then the date should be 1/1/2018
Solved! Go to Solution.
Project Run Time = VAR startdate = IF('LEANSavings '[SavingsStartDate].[Date] < DATE(2018,1,1),DATE(2018,1,1),'LEANSavings '[SavingsStartDate].[Date]) RETURN IF('LEANSavings '[OccurenceValue] = "Re-Occurring Savings", (TODAY() - startdate)/30, 1)
Project Run Time = VAR startdate = IF('LEANSavings '[SavingsStartDate].[Date] < DATE(2018,1,1),DATE(2018,1,1),'LEANSavings '[SavingsStartDate].[Date]) RETURN IF('LEANSavings '[OccurenceValue] = "Re-Occurring Savings", (TODAY() - startdate)/30, 1)
That is fantastic Greg, thank you.
I did start to do something very similar, buit keep forgetting whether to use 'Let' or Var'. Occassionally when I type in Var, PoiwerBI only gives me options like Var.P
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |