Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
yannick90
Frequent Visitor

Auto select previous date

Hello guys,

I'm coming up to you with an issue that has been frying my brain lately. Long story short, right now I'm comparing the data of two dates (this week vs previous week) hence on my calendar slicer, I have to click on two dates: but the objective of the user is to just click on one date (April 10) and it automatically compares with the data of the previous date (April 3rd)

 

yannick90_0-1654826512304.png

Any suggestions will be more than welcomed

Thank you 🙂

1 ACCEPTED SOLUTION

hi @danextian ,

 

Thanks for all the support. The user decided to go with a different approach instead. 

View solution in original post

9 REPLIES 9
danextian
Super User
Super User

Hi @yannick90 ,

 

Have you tried my approach in the PBIX i've previously shared? If that doesn't work, please share sanitized copy of your pbix (anonimized data, a representation of your data model) ?










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

hi @danextian ,

 

Thanks for all the support. The user decided to go with a different approach instead. 

yannick90
Frequent Visitor

Hi @danextian

Here is a sample of my date tables:

main calendar

yannick90_0-1654832956426.png

additional columns:

 

yannick90_1-1654832992544.png

if I select May 1st and April 24th, below is the result:

 

yannick90_2-1654833194896.png

but I want to get the same result just by selecting May 1st

Are you trying to compute for the value in the last 7 days a week ago or the value 7 days ago?










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hello @danextian,

 

I'm a bit confused by your statement. let me give a bit of context, the file is updated every monday. For example it was updated on April 24th, then May 1st and so on. So the scenario goes like this (take the data of "this week which is May 1st" and compare it to the data of last week which is April 24th

 

There is already a formula in place that is giving me the value of this week (2,8 millions) and last week (2,9 millions). 

Now the objective is to get the value of difference and variation by just selecting this week's date rather than selecting this week and last week

 

Let me know if it answers your question

Thanks  

What i was trying to say was, if today is Jan 30, are you trying to compare Jan 30 with Jan 23 or the from Jan 23 to 30 vs Jan 16 to Jan 22? 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian I see now, I am trying to compare Jan 30 with Jan 23

danextian
Super User
Super User

Hi @yannick90 ,

 

Please try this

Value Last Week = 
CALCULATE (
    [Sum of Values],
    FILTER ( ALL ( Dates ), Dates[Date] = MAX ( Dates[Date] ) - 7 )
)

 

If this doesn't work, please post a sample data and your dates table.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian ,

 

this is what I typed:

 

CalcInvLastWeek RsmC = CALCULATE(SUM('table'[data)]),
FILTER(ALLSELECTED('table'),'table'[WeekRank]=MAX('table'[WeekRank])-7))
 
This is what I get when I filtered May 22nd:
 
yannick90_1-1654900212540.png

 

I also tried the below but no luck:

 

CalcInvLastWeek RsmC = CALCULATE(SUM('table'[data)]),
FILTER(ALLSELECTED('table'),'table'[date]=MAX('table'[date])-7))

 

thanks you

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.