Forum Discussion
How to Hide Last 4 Quarters data in X axis Dynamically
- Anonymous6 years ago
HI rajendraongole1 ,
You can try to use the following measure to check current category and return tag, then you can use it on the line chart visual level filter to only display 'Y' tag records:
Measure = VAR _last = MAXX ( ALLSELECTED ( Test[YearQuarter] ), [YearQuarter] ) VAR _curr = LEFT ( MAX ( Test[YearQuarter] ), 4 ) & RIGHT ( MAX ( Test[YearQuarter] ), 1 ) VAR prev = LEFT ( _last, 4 ) - 1 & RIGHT ( _last, 1 ) RETURN IF ( _curr < prev, "Y", "N" )Regards,
Xiaoxin Sheng
Sample data would help.Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That said, do you have anything else than your Year Quarter to do date calculations on? If not, I would suggest creating a table via Enter Data that lists your year quarters. In the second column enter the last quarter that you actually want. Then in your measure, you can use LOOKUPVALUE to lookup the correct year quarter maximum to display and use that as a filter in your measure to return blank if you are beyond that year quarter.