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.
Hi All, hope you can help with this issue i am having -
I have created a "Period Table" within PowerBi that holds the date values as shown on below code:
let
TodaysDate = Date.From(DateTimeZone.FixedUtcNow()),
Ranges = {
{"Today",
TodaysDate,
TodaysDate,
1},
{"Current Week To Date",
Date.From(Date.StartOfWeek(TodaysDate)),
TodaysDate,
2},
{"Last 10 days",
Date.AddDays(TodaysDate,-10) + #duration(1,0,0,0),
TodaysDate,
3},
{"Current Month To Date",
Date.From(Date.StartOfMonth(TodaysDate)),
TodaysDate,
4},
{"Current Year To Date",
Date.From(Date.StartOfYear(TodaysDate)),
TodaysDate,
5},
{"Rolling Week",
Date.AddWeeks(TodaysDate,-1) + #duration(1,0,0,0),
TodaysDate,
6},
{"Rolling Month",
Date.AddMonths(TodaysDate,-1) + #duration(1,0,0,0),
TodaysDate,
7},
{"Last Month",
Date.AddMonths(Date.From(Date.StartOfMonth(TodaysDate)),-1),Date.StartOfMonth(TodaysDate),
8}
},
GetTables = List.Transform(Ranges,
each CreatePeriodTable(_{0}, _{1}, _{2}, _{3})),
Output = Table.Combine(GetTables)
in
Output
I have some problems with the "Last Month" section - i want to show all previous month data but it adds on the 1st day of the current month
Please can you advise what im doing wrong on the code:
{"Last Month",
Date.AddMonths(Date.From(Date.StartOfMonth(TodaysDate)),-1),Date.StartOfMonth(TodaysDate),
8}
Thank You
Hi @v7haquh,
For your issue, I recommand that you post it to Power Query forum. Other partners will read the forums regularly can either share their knowledge or learn from your interaction with us. So you will get the most qualified pool of respondents. Thank you for your understanding.
Best Regards,
Angelia
Many Thanks Angelia, i have done this
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 |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |