Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I have a Quarter slicer that holds the Quarter Name and Year and I'd like to use the "Year" value to only SUM values for all YoA_Codes <= Period_Year
My DAX is below but for some reason I'm not getting the correct result - I'm only expecting to see values for 2003-2020 based on the Quarter slicer value selected - also the SUMs are repeating for each year:
Can someone advise on where I'm going wrong please?
Hi @amitchandak
I've tried doing this but getting the total repeating across all columns - I'm expecting to see a split by Yoa_Code.
Am I missing something?
Gross Premium v2 =
VAR _maxi =
MAXX ( ALLSELECTED ( period ), VALUE ( Period[period_year] ) )
VAR _maxquarter =
MAXX ( ALLSELECTED( Period), Period[quarter_name])
RETURN
CALCULATE (
Gross[Gross Premium Total],
FILTER ( ALL (AccountYear), AccountYear[yoa_code] <= _maxi),
FILTER ( ALL (Period), Period[quarter_name] <= _maxquarter)
)
@brian0782 , Try to avoid all selected, unless that is not part of the range.
in with allselected you have add [year] =max(Year])
Hi @amitchandak
Can you clarify where this should be added please?
Gross Premium v2 = var _maxi = maxx(allselected(period), VALUE(Period[period_year]))
return
calculate(Gross[Gross Premium Total], filter(ALLSELECTED(AccountYear),AccountYear[yoa_code] <=_maxi))
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |