PowerPivot Slice one date - filter t-3 weeks

Anything related to PowerPivot and DAX Formuale
Ratamahatta123
Posts: 2
Joined: Fri Jan 22, 2021 9:16 pm

PowerPivot Slice one date - filter t-3 weeks

Postby Ratamahatta123 » Fri Jan 22, 2021 9:26 pm

Hello everyone,

I have an issue with PP which I cannot solve alone - hope you can help me.

I have weekly data which I would like to compare. The goal is to choose one date per pivot slicer (lets's call it w0) and deliver the remainder two weeks automaticall (w-1 and w-2). Dataset includes several entries per date (always the monday, beginning of the week).

The measure for w0 is the following:

=CALCULATE (
SUM ( flatfile[ValueEUR] );
FILTER(flatfile;flatfile[fcDate]=max([fcDate])))

The measure for w-1 is the following.

=CALCULATE (
SUM ( flatfile[ValueEUR] );
FILTER(flatfile;flatfile[fcDate]=max([fcDate])-7);
FILTER (flatfile; flatfile[Type (Actual/Plan)]="A");
ALL(flatfile[fcDate])
)

Unfortunately when I put in fcDate as a slicer and choose w0 there is no w-1 showing up - only if i have everything selected it does work.
I guess somehow I have to break the link between the data and the slicer - ALL() does not work apparently.

Do you have another idea?

Thanks
Ratamahatta

rwfigtree
Posts: 22
Joined: Tue Jan 05, 2021 8:49 pm
Location: Sydney, Australia

Re: PowerPivot Slice one date - filter t-3 weeks

Postby rwfigtree » Sun Jan 24, 2021 3:44 pm

Is this what you want?
See attached.

mW-1:=var x = MAX(Table1[date])-7
return CALCULATE(SUM(Table1[qty]),FILTER(ALL(Table1),Table1[date]=x))
Attachments
kek1.xlsx
(104.69 KiB) Downloaded 10 times

Ratamahatta123
Posts: 2
Joined: Fri Jan 22, 2021 9:16 pm

Re: PowerPivot Slice one date - filter t-3 weeks

Postby Ratamahatta123 » Fri Jan 29, 2021 11:25 pm

Thanks a lot, that helped yes.
The creation of a variable did the job!

Greets


Return to “PowerPivot/DAX”

Who is online

Users browsing this forum: No registered users and 6 guests