Forum Discussion
Same Week last Year Flag
Hi Anonymous ,
Please create two calculated columns.
week_and_year = YEAR('Table'[Dates])+WEEKNUM('Table'[Dates],2)*10000Column =
VAR _value_1 = 'Table'[Brand]
VAR _value_2 =
CALCULATE (
MAX ( 'Table'[week_and_year] ),
FILTER ( 'Table', 'Table'[Brand] = _value_1 )
)
VAR _value_3 =
CALCULATE (
MIN ( 'Table'[week_and_year] ),
FILTER ( 'Table', 'Table'[Brand] = _value_1 )
)
RETURN
SWITCH (
TRUE (),
'Table'[Brand] = _value_1
&& _value_2 - _value_3 = 1, "Y",
"N"
)
The result should be like this.
Attach the PBIX file for reference. Hope it helps.
If this doesn't work for you or I misunderstand your needs, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.
It makes it easier to give you a solution.
- Sample (dummy dataset) data as text, use the table tool in the editing bar.
- Expected output from sample data.
- Explanation in words of how to get from 1. to 2.
Best Regards,
Community Support Team_Gao
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- Anonymous4 years agoNot applicable
First, thanks so much for your response!
I attempted to implement this solution, but received "N" for every single result, so it doesn't appear to be working. I'd love to include a more thorough file that includes an anonymized version of the data I'm working with, but I don't see a way to attach files here. Is there some way I can send it to you?
Thanks!
- Anonymous4 years agoNot applicable
Hi Anonymous ,
Please read this post.
Best Regards,
Community Support Team_GaoIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- Anonymous4 years agoNot applicable
I've attached two columns of anonymized data from the project I'm working on. There are several repeats in dates/brands, but this is because there is an additional column in my actual file that includes all of the different partners/stores we deal with.
Let me know if I can provide anything else and thanks again!
Link: https://drive.google.com/file/d/1YmP5ETQ4uMcwVMCTHKzV-F3Nsc1qazpZ/view?usp=sharing