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.
Hi Community,
I would like to show only the last two finanical quarters in the following matrix.
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
Solved! Go to 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)
@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) )
@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)
@Greg_Deckler thanks, but this logic shows the current qtr as well. I would like to show only the last two quarters.
I think the issue is with
@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)
@Anonymous I misunderstood. I thought you wanted the last two quarters each year. Hang on...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |