cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 1,216 guests
Please welcome our newest community members: