Forum Discussion
Previous month based on slicer
My god this forum, 3rd time I reply and I get an error
So... still not good as you apply "static DAX" or something non-slicer related.
I need that the gauge dynamically shows me the next month of the slicer date I select, so if I select Jaunary it shows me February and if I change to March it shows me April.
I find strange that MS has not implemented something that is slicer-dependant
Hi Treawlony ,
We can create a calculated table contain the data in the single visual, then create a measure using following measure.
isInNextMonth =
VAR tMonth =
MAX ( 'Table'[Date] )
VAR nMonth =
IF (
MONTH ( tMonth ) = 12,
DATE ( YEAR ( tMonth ) + 1, 1, 1 ),
DATE ( YEAR ( tMonth ), MONTH ( tMonth ) + 1, 1 )
)
RETURN
IF (
YEAR ( max ( 'Table-Copy'[Date] ) ) = YEAR ( nMonth )
&& MONTH (max ( 'Table-Copy'[Date] ) ) = MONTH ( nMonth ),
1,
0
)put it in the Visual Filter, set condition is 1.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Treawlony7 years agoRegular Visitor
mmmm interesting, let me try it and you might win a solution :D
- Treawlony7 years agoRegular Visitor
not really make it work, but got few time to work on it lately
- v-lid-msft7 years ago
Community Support
Hi Treawlony ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.