Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Dear Power BI Representative,
I attended the Power BI Data Modeling and Shaping Training course and in section 6D step d, the invocation of the function is not resolving to the dates since the year start instead every record is showing a value of 96 and I do not understand why my output is wrong. The function the text provided was added below. Under the test invoke function under the transformation tab it is resolving however in sales it is still keeping every record at 96. Please advise.
Thank you.
let
Source = (TransactionDate as date) => let
YearStart = #date(Date.Year(TransactionDate),1,1),
#"DateDiff" = Duration.From(TransactionDate-YearStart),
#"NumberDays" = Duration.Days(#"DateDiff")+1
in
#"NumberDays"
in
Source
Solved! Go to Solution.
@lt79_Pax , Please find my script for the same. I have date column
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Year Start", each #date(Date.Year([Date]),1,1)),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Datediff", each Duration.Days([Date]-[Year Start]))
@lt79_Pax , Please find my script for the same. I have date column
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Year Start", each #date(Date.Year([Date]),1,1)),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Datediff", each Duration.Days([Date]-[Year Start]))
Thank you Amitchandak. The [Date] field needed to be used instead of "Select the current date from the calendar" in the lab guide. Thank you for providing the corrected field.
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |