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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JS_UNI4C
Helper I
Helper I

DAX measure to calculate based on selected value "-1"

Hello all,

 

Hoping someone can help me. Currently I am creating an internal sales dashboard and one of the measures we use regularly is comparing week vs week i.e. current week vs prior week, current week vs same week last year and the year before.

 

I managed to solve nearly all the challenges by using "ISO Weeks" which I included in my calendar table but the final piece of the puzzle is that I would like to create the exact same visual as below but have it show Current Week ("CW") vs Prior Week ("PW") but I would like this automated so ideally thought there may be a way to use the calculate and selectedvalue functions to achieve this but can't quite wrap my head around it. 

 

So if a use selects week 4 as below, the CW green bar will show the current week's sales but I would like the target line to show week 3. 

 

Is there a way to put this into a DAX calculate measure somehow? 

 

JS_UNI4C_0-1708020372343.png

 

Some details of the tables I have in the file:

 

JS_UNI4C_1-1708020597645.png

 

JS_UNI4C_2-1708020670421.png

JS_UNI4C_3-1708020706860.png

 

I also tried playing around with the below measure but couldn't really get it to work with my ISO Weeks so if this is the answer and you know how to adapt it, please let me know. I was trying to lookup the ISO week reference in my calendar table based on the CurrentDate table (which updates to todays date automatically everytime the file is opened).

 

JS_UNI4C_4-1708020909527.png

 

Any and all help is appreciated. Thanks in advance.

 

Kind regards,

 

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @JS_UNI4C check link, could be good example for your case.





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

Proud to be a Super User!






View solution in original post

2 REPLIES 2
JS_UNI4C
Helper I
Helper I

Perfect!

some_bih
Super User
Super User

Hi @JS_UNI4C check link, could be good example for your case.





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

Proud to be a Super User!






Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.