Forum Discussion
Sort by most recent 12 months
- 6 years ago
Hi, j_b_pbi
Based on your description, I created data to reproduce your scenario.
Table:
Calendar(a calculated table):
Calendar = CALENDARAUTO()There is a one-to-one relationship between two tables.
You may create a calculated column and a measure as below.
Calculated column: Monthnum = MONTH('Calendar'[Date]) Measure: IsDisplay = var _year = SELECTEDVALUE('Calendar'[Date].[Year]) var _month = SELECTEDVALUE('Calendar'[Monthnum]) return IF( OR( _year = YEAR(TODAY())&&_month<MONTH(TODAY()), _year = YEAR(TODAY())-1&&_month>=MONTH(TODAY()) ), 1, 0 )Then you need to put the measure in the visual level filter to display the corresponding result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, j_b_pbi
Based on your description, I created data to reproduce your scenario.
Table:
Calendar(a calculated table):
Calendar = CALENDARAUTO()
There is a one-to-one relationship between two tables.
You may create a calculated column and a measure as below.
Calculated column:
Monthnum = MONTH('Calendar'[Date])
Measure:
IsDisplay =
var _year = SELECTEDVALUE('Calendar'[Date].[Year])
var _month = SELECTEDVALUE('Calendar'[Monthnum])
return
IF(
OR(
_year = YEAR(TODAY())&&_month<MONTH(TODAY()),
_year = YEAR(TODAY())-1&&_month>=MONTH(TODAY())
),
1,
0
)
Then you need to put the measure in the visual level filter to display the corresponding result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Allan v-alq-msft ,
Thanks for your help.
I can't quite get the breakdown over months. Am I missing something in the hierachy?
Thanks
- j_b_pbi6 years agoFrequent Visitor