Forum Discussion
Max common week
- Anonymous5 years ago
Hi Anonymous ,
What's the calculation logic of Max common week? If you have the table with below data, what is Max common week? It is still 13 or other value? Could you please some original data in Table and your expected result with examples? Thank you.
If Max common week is 12, then you can create a measure as below. Please find the attachment for the details.
Measure = VAR _tab = SUMMARIZE ( 'Table', 'Dim Calendar'[Year], 'Dim Calendar'[No Week], "numberofweek", CALCULATE ( COUNT ( 'Table'[CATEGORY] ), FILTER ( ALL ( 'Table' ), YEAR ( 'Table'[DATE] ) = SELECTEDVALUE ( 'Dim Calendar'[Year] ) && WEEKNUM ( 'Table'[DATE] ) = SELECTEDVALUE ( 'Dim Calendar'[No Week] ) ) ) ) RETURN MAXX ( FILTER ( _tab, [numberofweek] = MAXX ( _tab, [numberofweek] ) ), [No Week] )Best Regards
Hi Anonymous ,
What's the calculation logic of Max common week? If you have the table with below data, what is Max common week? It is still 13 or other value? Could you please some original data in Table and your expected result with examples? Thank you.
If Max common week is 12, then you can create a measure as below. Please find the attachment for the details.
Measure =
VAR _tab =
SUMMARIZE (
'Table',
'Dim Calendar'[Year],
'Dim Calendar'[No Week],
"numberofweek",
CALCULATE (
COUNT ( 'Table'[CATEGORY] ),
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[DATE] ) = SELECTEDVALUE ( 'Dim Calendar'[Year] )
&& WEEKNUM ( 'Table'[DATE] ) = SELECTEDVALUE ( 'Dim Calendar'[No Week] )
)
)
)
RETURN
MAXX (
FILTER ( _tab, [numberofweek] = MAXX ( _tab, [numberofweek] ) ),
[No Week]
)
Best Regards