Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Solved! Go to Solution.
HI @Anonymous,
You can refer to following steps to achieve your requirement.
Steps:
1. Add WeekNum to original table and create a what if parameter table with index and day of weeks.
= WEEKNUM([Date],1) Calculate table: Selected = SELECTCOLUMNS(GENERATESERIES(1,7,1),"Index",[Value],"Day of Week",FORMAT([Value],"dddd"))
2. Write a measure to check weeknum and selected day of week to display detail information.
Detail = VAR currWeek = MAX ( 'Table 2'[weekNum] ) VAR _weeknow = WEEKNUM ( TODAY (), 1 ) VAR inRange = IF ( MAX ( 'Table 2'[Date] ) IN CALCULATETABLE ( VALUES ( 'Table 2'[Date] ), FILTER ( ALLSELECTED ( 'Table 2' ), 'Table 2'[weekNum] IN { _weeknow - 1, _weeknow, _weeknow + 1 } && YEAR ( 'Table 2'[Date] ) = YEAR ( MAX ( 'Table 2'[Date] ) ) ) ), "Y", BLANK () ) VAR selectedIndex = SELECTEDVALUE ( 'Selected'[Index] ) RETURN IF ( inRange <> BLANK (), CONCATENATEX ( FILTER ( VALUES ( 'Table 2'[Date] ), IF ( currWeek = _weeknow - 1, WEEKDAY ( [Date], 1 ) >= selectedIndex, IF ( currWeek = _weeknow, WEEKDAY ( [Date], 1 ) < selectedIndex ) ) ), FORMAT ( [Date], "dddd" ), "," ) )
3. Create table visual and slicer to show correspondent graph.
Regards,
Xiaoxin Sheng
Hii @Anonymousm,
>>So I bring the period I need. But within these weeks I need to bring the days of the week, which starts on Friday of the previous week, and ends on the monday of the current week and another that starts at the Wednesday of the last week, and ends on the Thursday of the current week for exemple.
I'm not so clear for your description, can you please explain more about these with expected result?
Regards,
Xiaoxin Sheng
Hi V-shex-msft thanks for reply!
So, i need to bring 3 weeks, current week, previous week and next week, always.
Example considering our current date.
W2 January (day 6 to 12, week Previous).
W3 January (day 13 to 19, us current week),
W4 January (day 20 to 26, next week)
After that, i need to bring the day range with the day name of de week.
So here theres my problem, because, i need to make some ranges:
Exemple: A filter with start ever on Tuesday of the W2 and ends ever Wednesday of W3.
So if we have this.
W2: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.
W3: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.
W4: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.
The filter need to bring this
W2: Tuesday, Wednesday, Thursday, Friday, Saturday.
W3: Sunday, Monday, Tuesday, Wednesday.
Thanks for helping!
HI @Anonymous,
You can refer to following steps to achieve your requirement.
Steps:
1. Add WeekNum to original table and create a what if parameter table with index and day of weeks.
= WEEKNUM([Date],1) Calculate table: Selected = SELECTCOLUMNS(GENERATESERIES(1,7,1),"Index",[Value],"Day of Week",FORMAT([Value],"dddd"))
2. Write a measure to check weeknum and selected day of week to display detail information.
Detail = VAR currWeek = MAX ( 'Table 2'[weekNum] ) VAR _weeknow = WEEKNUM ( TODAY (), 1 ) VAR inRange = IF ( MAX ( 'Table 2'[Date] ) IN CALCULATETABLE ( VALUES ( 'Table 2'[Date] ), FILTER ( ALLSELECTED ( 'Table 2' ), 'Table 2'[weekNum] IN { _weeknow - 1, _weeknow, _weeknow + 1 } && YEAR ( 'Table 2'[Date] ) = YEAR ( MAX ( 'Table 2'[Date] ) ) ) ), "Y", BLANK () ) VAR selectedIndex = SELECTEDVALUE ( 'Selected'[Index] ) RETURN IF ( inRange <> BLANK (), CONCATENATEX ( FILTER ( VALUES ( 'Table 2'[Date] ), IF ( currWeek = _weeknow - 1, WEEKDAY ( [Date], 1 ) >= selectedIndex, IF ( currWeek = _weeknow, WEEKDAY ( [Date], 1 ) < selectedIndex ) ) ), FORMAT ( [Date], "dddd" ), "," ) )
3. Create table visual and slicer to show correspondent graph.
Regards,
Xiaoxin Sheng
That's is not possible in Power BI?
User | Count |
---|---|
139 | |
113 | |
103 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |