The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I'm trying to create a measure to calculate a value that is filtered to current year that I can use in a line chart to see results over a 52 week period.
This is not working:
Solved! Go to Solution.
@jdwalker5 , Try like
CURRENT_YEAR_CALCULATION =
VAR CUR_YR = MAXX(allselected('DATA'), 'DATA'[YEAR_NBR])
VAR CALC = CALCULATE(
DIVIDE('DATA'[NUMERATOR], 'DATA'[DENOMINATOR]),
'DATA'[YEAR_NBR] = CUR_YR
)
RETURN CALC
@jdwalker5 , Try like
CURRENT_YEAR_CALCULATION =
VAR CUR_YR = MAXX(allselected('DATA'), 'DATA'[YEAR_NBR])
VAR CALC = CALCULATE(
DIVIDE('DATA'[NUMERATOR], 'DATA'[DENOMINATOR]),
'DATA'[YEAR_NBR] = CUR_YR
)
RETURN CALC
That's the ticket! Thanks for you your help @amitchandak.
FYI, I was able to get it to work by creating a custom column using MAX('DATE'[YEAR]), but I prefer to use your solution.
User | Count |
---|---|
87 | |
84 | |
36 | |
35 | |
30 |
User | Count |
---|---|
96 | |
75 | |
67 | |
52 | |
52 |