Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
138 | |
107 | |
104 | |
82 | |
63 |