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
Hi rajendraongole1 ,
Can you share the pbix / data on Google / One Drive and paste the linke here. Please also share what is the solution you expect.
Cheers
CheenuSing
Thanks for your reply.
I will two visuals :
Visual-1, as of now i have all Quarters data information till date.
Requirement is in Visual-2
though i have 2019 all Quarter data, I want to showcase data upto 2018-4 Quarter only untill 2020-01 the data of 2019.01 should comes automatically without using manual filter condition.
- rajendraongole16 years ago
Super User
- Greg_Deckler6 years ago
Community Champion
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.
- tex6286 years ago
Community Champion
This dynamically identifies the 4 most recent quarters, including the current one:
Check = VAR CurrentQ = QUARTER(today()) VAR CurrentY = YEAR(Today()) Return IF( YEAR('Table (2)'[Date]) = CurrentY ; 1 ; IF( YEAR('Table (2)'[Date]) = CurrentY -1 && QUARTER('Table (2)'[Date]) >= 1+CurrentQ ; 1 ; BLANK()))
Br,
J