Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show only last two financial quarters on matrix

Hi Community,

 

I would like to show only the last two finanical quarters in the following matrix.

ExcelPBI_0-1632382335996.png  

ExcelPBI_1-1632382365855.png

Above is the date table I used.  How can I do it?

 

PBI file:

https://1drv.ms/u/s!Ag919_pO_UKrgSCNB_A12UIJm0KH?e=eQeIMV

 

Thanks

 

1 ACCEPTED SOLUTION

@Anonymous Fixed:

Selector 2 = 
    VAR __CurrentQuarter = MAX('Date'[Qtr Rank])
    VAR __Table = 
        FILTER(
            SUMMARIZE(ALL('Date'),[Qtr Rank],"__Measure",COUNTROWS(DISTINCT('Table'[Client_id]))),
            NOT(ISBLANK([__Measure]))
        )
    VAR __MaxQuarter = MAXX(__Table,[Qtr Rank]) - 1
    VAR __MinQuarter = __MaxQuarter - 1
RETURN
    IF(__CurrentQuarter = __MaxQuarter || __CurrentQuarter = __MinQuarter,1,0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , if it based on today

 

QTD Today=
var _max = today() // or max date date of fact // maxx(allselected('Date'), 'Date'[Date])
var _month = mod(month(_max),3)
var _min = date(year(_max),month(_max) +(-1* if(_month=0,3,_month) -3) ,1)
var _day = _max
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )

Greg_Deckler
Super User
Super User

@Anonymous I used a Complex Selector like below (PBIX is attached below sig):

Selector = 
    VAR __CurrentQuarter = MAX('Date'[FY Qtr No])
    VAR __Table = 
        FILTER(
            SUMMARIZE(ALLEXCEPT('Date','Date'[FY Year]),[FY Qtr No],"__Measure",COUNTROWS(DISTINCT('Table'[Client_id]))),
            NOT(ISBLANK([__Measure]))
        )
    VAR __MaxQuarter = MAXX(__Table,[FY Qtr No])
    VAR __MinQuarter = __MaxQuarter - 1
RETURN
    IF(__CurrentQuarter = __MaxQuarter || __CurrentQuarter = __MinQuarter,1,0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler thanks, but this logic shows the current qtr as well. I would like to show only the last two quarters.

ExcelPBI_0-1632385066742.png

I think the issue is with 

VAR __CurrentQuarter = MAX('Date'[FY Qtr No]) that returns 4. but the current FY qtr No is 1.
 
ExcelPBI_1-1632385191356.png

 

Please suggest.

@Anonymous Fixed:

Selector 2 = 
    VAR __CurrentQuarter = MAX('Date'[Qtr Rank])
    VAR __Table = 
        FILTER(
            SUMMARIZE(ALL('Date'),[Qtr Rank],"__Measure",COUNTROWS(DISTINCT('Table'[Client_id]))),
            NOT(ISBLANK([__Measure]))
        )
    VAR __MaxQuarter = MAXX(__Table,[Qtr Rank]) - 1
    VAR __MinQuarter = __MaxQuarter - 1
RETURN
    IF(__CurrentQuarter = __MaxQuarter || __CurrentQuarter = __MinQuarter,1,0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Anonymous I misunderstood. I thought you wanted the last two quarters each year. Hang on...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.