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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
suvechha
Helper IV
Helper IV

How to show current week data in graph ?

Hi there, How to show current week data in graph, Today is Monday so my requirement is to show Monday's data in the below graph and Tuesday will be zero.

 

The below image showing for the full month of Aug 2020.

 

How to show only for 24Aug2020 which is Monday and 25Aug2020 which is Tuesday ?

 

sample model : https://1drv.ms/u/s!AhqwbtIVEKQ2ayeFIrNg2IWBFjs?e=kx38Ia

Today.PNG

1 ACCEPTED SOLUTION

Hi @suvechha ,

 

Does the max(week) mean the week of the largest date in WorkOrder table?

If yes, we can create a measure to meet your requirement.

 

Max week = 
var _max_date = CALCULATE(MAX(WorkOrder[Date]),ALLSELECTED(WorkOrder))
var _week = CALCULATE(MAX('Date'[Week Number]),FILTER(ALLSELECTED('Date'),'Date'[Date]=_max_date))
return
CALCULATE(COUNT(WorkOrder[WORKORDERID]),FILTER('Date','Date'[Year]=YEAR(_max_date)&&'Date'[Week Number]=_week))

 

How1.jpg

 

The sample data has the max date is 2020/8/25, so it displays the 35 week’s Monday and Tuesday.

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

5 REPLIES 5
v-zhenbw-msft
Community Support
Community Support

Hi @suvechha ,

 

We can create a measure and put it in Filters on this page to meet your requirement.

 

1. Create a Measure to determine whether the week of today and tomorrow is equal to the week of the date table.

 

Today = 
var _today = FORMAT(TODAY(),"dddd")
var _tomorrow = FORMAT(TODAY()+1,"dddd")
return
IF(
    MAX('Date'[DayOfWeek])=_today||MAX('Date'[DayOfWeek])=_tomorrow,1,0)

 

2. Then select the line chart and put this measure in Filters on this page, configure it as 1.

 

How1.jpg

 

How2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

Hi there,

 

How to show the report for the max(week) i.e from Monday to Sunday.

 

Thanks

Hi @suvechha ,

 

Does the max(week) mean the week of the largest date in WorkOrder table?

If yes, we can create a measure to meet your requirement.

 

Max week = 
var _max_date = CALCULATE(MAX(WorkOrder[Date]),ALLSELECTED(WorkOrder))
var _week = CALCULATE(MAX('Date'[Week Number]),FILTER(ALLSELECTED('Date'),'Date'[Date]=_max_date))
return
CALCULATE(COUNT(WorkOrder[WORKORDERID]),FILTER('Date','Date'[Year]=YEAR(_max_date)&&'Date'[Week Number]=_week))

 

How1.jpg

 

The sample data has the max date is 2020/8/25, so it displays the 35 week’s Monday and Tuesday.

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

Hi Amit,

 

Please kindly help, I can't add this three columns in my Date table :

Week = if('Date'[Week Number]<10,'Date'[Year]*10 & 'Date'[Week Number],'Date'[Year]&'Date'[Week Number])
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Week name = [Week Start date] & " to "& [Week End date]

 

My Date Table :

 

Date =
ADDCOLUMNS (
CALENDAR (DATE(2020,1,1), DATE(2021,12,31)),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"Monthnumber", FORMAT ( [Date], "MM" ),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ),
"MonthNameLong", FORMAT ( [Date], "mmmm" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
"DayOfWeek", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"Quarter", "Q" & FORMAT ( [Date], "Q" ),
"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ),
"Week Start date" , [Date] + -1*WEEKDAY([Date],2)+1,
"Week End date" , [Date] + 7 -1*WEEKDAY([Date],2),
"Week Number" , WEEKNUM([Date],2),
"Weekday" , WEEKDAY([Date],2),
"WeekDay Name" , FORMAT([Date],"ddd"))
 
 
 
Please assist.
 
Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.