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
SCNCKS1
Helper I
Helper I

Previous Weeks Data with date slicer

Hi - I am creating a line chart that is supposed to show - screen shot of what my report looks like is below along with a table showing there should be at least 1 point green and orange.

   - data from the previous week

  - data from week before the previous week

  - data year to date.

 

The code i am using is:

Value Current Week =
    CALCULATE(
        [Value/DAY],
        FILTER(ALL('Date'), 'Date'[Week Rank] = Max('Date'[Week Rank]) - 1))
 
Slicer is Year/Month/Day
There is data, i have confirmed. My report has data through 7/30/2023 which is week 31. Any assistance would be much appreciated.
 
SCNCKS1_0-1691095245877.png SCNCKS1_1-1691095306824.png

 

 

1 ACCEPTED SOLUTION

Hi Foodd - the powerbi file is attached to the SharePoint data, which is sensitive, i am not able to post the data online. 

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@SCNCKS1 try this for prev week

 

Value Prev Week =
VAR __selectedWeekRank = SELECTEDVALUE ( 'Date'[Week Rank] )
VAR __prevWeekRank = __selectedWeekRank - 1
RETURN
    CALCULATE(
        [Value/DAY],
        'Date'[Week Rank] - __prevWeekRanke
    )

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Hi Foodd - the powerbi file is attached to the SharePoint data, which is sensitive, i am not able to post the data online. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.