cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mohan_g_das1986 Regular Visitor
Regular Visitor

VERY URGENT!! - Show all Completed Week data

Hi, I need an very urgent request to show the units for only completed weeks; below is the week structure

 

  1. When Today is July 10, 2019 - Last Completed Week is - July 01, 2019 (Monday) to July 7, 2019 (Sunday)
  2. When Today is July 20, 2019 - Last Completed Week is - July 08, 2019 (Monday) to July 14, 2019 (Sunday)

Below is the link for my previous question still no answer;

https://community.powerbi.com/t5/Desktop/DAX-to-show-all-N-completed-weeks-data/m-p/745014#M359143

i tried Weekoffset & it works for last 2 weeks and not for all completed weeks (maybe 13 or 15 weeks)

Used another DAX measure 

Flag_Test = If(format([Last Refreshed], "mm dd yyyy") = format(Calendar_time[Date], "mm dd yyyy"),"Current",

            If((([Last Refreshed]- Calendar_time[Date])-1) < 0,"Future","Past"))
 
Eventhough my flag is past still incomplete w
Completed_Flag_issue.JPG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: VERY URGENT!! - Show all Completed Week data

Hi @mohan_g_das1986 

Create new tables

calendar =
ADDCOLUMNS (
    CALENDARAUTO (),
    "year", YEAR ( [date] ),
    "month", MONTH ( [date] ),
    "weeknum", WEEKNUM ( [date], 2 ),
    "year-weeknum", YEAR ( [Date] ) & WEEKNUM ( [Date], 2 )
)
weekset = VALUES('calendar'[weeknum])

Don't create any relationship for "weekset" table

 

Create measures in Sheet3

selected_weeknumber = SELECTEDVALUE(weekset[weeknum])

current_week = WEEKNUM(TODAY(),2)

last week = [current_week]-[selected_weeknumber]

flag = IF(MAX('calendar'[weeknum])<[current_week]&&MAX('calendar'[weeknum])>=[last week],1,0)
6.png

 

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: VERY URGENT!! - Show all Completed Week data

Hi @mohan_g_das1986 

Create new tables

calendar =
ADDCOLUMNS (
    CALENDARAUTO (),
    "year", YEAR ( [date] ),
    "month", MONTH ( [date] ),
    "weeknum", WEEKNUM ( [date], 2 ),
    "year-weeknum", YEAR ( [Date] ) & WEEKNUM ( [Date], 2 )
)
weekset = VALUES('calendar'[weeknum])

Don't create any relationship for "weekset" table

 

Create measures in Sheet3

selected_weeknumber = SELECTEDVALUE(weekset[weeknum])

current_week = WEEKNUM(TODAY(),2)

last week = [current_week]-[selected_weeknumber]

flag = IF(MAX('calendar'[weeknum])<[current_week]&&MAX('calendar'[weeknum])>=[last week],1,0)
6.png

 

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors