Forum Discussion
filter table by year and weekyear
- 5 years ago
Hi noliverte ,
When I reply you the current week is 51, so you want to show data about text 50 right?
You can create a measure like this, put it in the table visual filter and set its value as 1:
A = IF ( WEEKNUM ( TODAY (), 2 ) - 1 = WEEKNUM ( SELECTEDVALUE ( 'Table'[Date] ), 2 ), 1, 0 )Attached the sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Ashish_Mathur,
Thanks for taking time to respond to me,
In my final result, I'd like to have a simple table in powerbi with the text corresponding to the number of the previous week.
Table : Explications
I would like to have each week the text which corresponds to the previous week.
How to build this measure?
(this week number is 51)
I'd like to have automatically simple text with "text week 50"
Have a nice day
Noliverte
Hi noliverte ,
Not certain what is your table look like but you can try to create a measure like this:
explications =
IF (
SELECTEDVALUE ( 'Calendar'[Weeknum] )
= WEEKNUM ( SELECTEDVALUE ( 'Table'[Date] ), 2 ),
"text week "
& ( WEEKNUM ( SELECTEDVALUE ( 'Table'[Date] ), 2 ) - 1 )
)
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- noliverte5 years ago
Helper III
Hello v-yingil,
Thank you for your explanation and your file, but it's not exactly what I expect.
In view report I'd like one table (without filters).
Table has 2 cols (date, explications)
explications isn't a measure (Data come from an Google spreadsheet file)Table
I would like to create a measure that would be able to display only the text (taken from the table above) from the previous week.
(if the current week number is 50, the displayed text will be "text week 49")
Thank you for your help and advice
Noliverte
- v-yingjl5 years ago
Community Support
Hi noliverte ,
When I reply you the current week is 51, so you want to show data about text 50 right?
You can create a measure like this, put it in the table visual filter and set its value as 1:
A = IF ( WEEKNUM ( TODAY (), 2 ) - 1 = WEEKNUM ( SELECTEDVALUE ( 'Table'[Date] ), 2 ), 1, 0 )Attached the sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- noliverte5 years ago
Helper III
Hi v-yingil,
Congratulation it works fine.
Thank you very much for your precious help.I've added a if statement to fit with my final report
A = IF( YEAR(TODAY()) = YEAR(SELECTEDVALUE('Table'[Date])), IF ( WEEKNUM ( TODAY (), 2 ) - 1 = WEEKNUM ( SELECTEDVALUE ( 'Table'[Date] ), 2 ), 1, 0 ), 0 )One last request with your pbix.
In my final powerbi file, I have to hide the date fied to only show explanations...
Do you know how i could remove this field from my table?
In your file, if I remove this date field from the table, the explanation field also disappearsHave a nice day
Noliverte