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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.