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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DanduMani104
Helper III
Helper III

Current week to last 6 week Individual week count

I have week no column and Termination year column and Tour Request no column and Qt Exclude Flag column in a table in power bi desktop. I have a week column from 1 to 52 week numbers. I want to show the distinct count of Tour Request no of Every week of Termination Year Current year and Qt Exclude Flag '0' individually up to current week in the line chart .and the Current week to Past 6 weeks count should be Dynamically change weekly when I refresh the report

DanduMani104_0-1704978141257.png

Like this. for example my currentweek is 48, the linechart should show the current week and Last 6 weeks Data for individual weeks.

 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file, and try using WINDOW DAX function.

Jihwan_Kim_1-1705033659310.png

 

 

Jihwan_Kim_0-1705033643418.png

 

WINDOW function (DAX) - DAX | Microsoft Learn

 

Quantity last 6 weeks: =
VAR _t =
    FILTER (
        ALL ( 'Calendar'[WeekStartDate], 'Calendar'[Year-Week] ),
        [Quantity:] <> BLANK ()
    )
RETURN
    CALCULATE (
        [Quantity:],
        KEEPFILTERS (
            WINDOW ( 1, ABS, 6, ABS, _t, ORDERBY ( 'Calendar'[WeekStartDate], DESC ) )
        )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

DanduMani104_0-1705299485504.png

My Data Model is look like this..

DanduMani104_1-1705299626164.png

I want To show Only Current Week to Past 5 weeks Count data in this visual and dynamically the current week number should be change weekly when dataset is refreshed

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.