Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
For the week selection I have found in the community forum this solution
(dDate as date) => let Quelle = if Number.RoundDown((Date.DayOfYear(dDate )-(Date.DayOfWeek(dDate , Day.Monday)+1)+10)/7)=0 then Number.ToText(Date.Year(dDate)-1)& Text.End("0" & Number.ToText(Number.RoundDown((Date.DayOfYear(#date(Date.Year(dDate )-1,12,31))-(Date.DayOfWeek(#date(Date.Year(dDate )-1,12,31), Day.Monday)+1)+10)/7)),2) else if (Number.RoundDown((Date.DayOfYear(dDate )-(Date.DayOfWeek(dDate , Day.Monday)+1)+10)/7)=53 and (Date.DayOfWeek(#date(Date.Year(dDate ),12,31), Day.Monday)+1<4)) then Number.ToText(Date.Year(dDate)+1)&"01" else Number.ToText(Date.Year(dDate))& Text.End("0"&Number.ToText(Number.RoundDown((Date.DayOfYear(dDate)-(Date.DayOfWeek(dDate, Day.Monday)+1)+10)/7)),2) in Quelle
and had to save this in a new quary as DateToYYYYWW and had to add in my original quary this one
let CurrentYYYYWW= DateToYYYYWW(Date.From(DateTime.LocalNow())), NextWeek = DateToYYYYWW(Date.AddDays(Date.From(DateTime.LocalNow()),7)) in NextWeek
let
Source = SapBusinessWarehouse.Cubes("E9Esap.nestle.com", "E9E", "102", "USERS", [Implementation="2.0", LanguageCode="EN"]),
Y6DS1MC0 = Source{[Name="Y6DS1MC0"]}[Data],
#"Y6DS1MC0/Y6DS1MC0Q_001" = Y6DS1MC0{[Id="Y6DS1MC0/Y6DS1MC0Q_001"]}[Data],
#"Added Items" = Cube.Transform(#"Y6DS1MC0/Y6DS1MC0Q_001",
CurrentYYYYWW= DateToYYYYWW(Date.From(DateTime.LocalNow())),
{
{Cube.ApplyParameter, "[YMMPAREA]", {{"[YPLGAREA].[D]"}}},
{Cube.ApplyParameter, "[YPMUNIT]", {"[YUNITS].[PUM]"}},
{Cube.ApplyParameter, "[YSOCLMTH]", {{}}},
{Cube.ApplyParameter, "[YSALESOR]", {{"[0SALESORG].[NL10]"}}},
{Cube.ApplyParameter, "[YSNPCPH2]", {{"[YMAT_COMP__0PRODH2].[NLK]"}}},
But I get this message.
Expression.Error: The name 'CurrentYYYYWW' wasn't recognized. Make sure it's spelled correctly.
Does anyone knows how to solve this?
Your Cube.Transform call is not in the right format.
Cube.Transform - PowerQuery M | Microsoft Learn
You may want to clear out the sensitive information from your examples.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
10 | |
10 | |
8 | |
7 |