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.
Hello Exports,
As you see in photot attached, I am not referencing time and used time intelligence function and it give me a number, and npte in my data in data I have year only,
How I can deal with that? anf if its no give me zero, it can make % between 2015 % 2020 whwn I am not referncing time.
Solved! Go to Solution.
Hi @Anonymous
Maybe you can try this expression to do that:
yoy % =
VAR _amountly =
CALCULATE ( [value], DATEADD ( 'Table'[Date], -1, YEAR ) )
VAR _yoy = [value] - _amountly
VAR _result =
DIVIDE ( _yoy, ABS ( _amountly ) )
VAR _minyear =
CALCULATE (
[value],
FILTER (
ALLSELECTED ( 'Table'[Date] ),
[Date] >= DATE ( YEAR ( MIN ( 'Table'[Date] ) ), 1, 1 )
&& [Date] <= DATE ( YEAR ( MIN ( 'Table'[Date] ) ), 12, 31 )
)
)
VAR _maxyear =
CALCULATE (
[value],
FILTER (
ALLSELECTED ( 'Table'[Date] ),
[Date] >= DATE ( YEAR ( MAX ( 'Table'[Date] ) ), 1, 1 )
&& [Date] <= DATE ( YEAR ( MAX ( 'Table'[Date] ) ), 12, 31 )
)
)
RETURN
IF (
ISFILTERED ( 'Table'[Date].[Year] ),
_result + 0,
DIVIDE ( _maxyear - _minyear, ABS ( _minyear ) ) + 0
)
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Maybe you can try this expression to do that:
yoy % =
VAR _amountly =
CALCULATE ( [value], DATEADD ( 'Table'[Date], -1, YEAR ) )
VAR _yoy = [value] - _amountly
VAR _result =
DIVIDE ( _yoy, ABS ( _amountly ) )
VAR _minyear =
CALCULATE (
[value],
FILTER (
ALLSELECTED ( 'Table'[Date] ),
[Date] >= DATE ( YEAR ( MIN ( 'Table'[Date] ) ), 1, 1 )
&& [Date] <= DATE ( YEAR ( MIN ( 'Table'[Date] ) ), 12, 31 )
)
)
VAR _maxyear =
CALCULATE (
[value],
FILTER (
ALLSELECTED ( 'Table'[Date] ),
[Date] >= DATE ( YEAR ( MAX ( 'Table'[Date] ) ), 1, 1 )
&& [Date] <= DATE ( YEAR ( MAX ( 'Table'[Date] ) ), 12, 31 )
)
)
RETURN
IF (
ISFILTERED ( 'Table'[Date].[Year] ),
_result + 0,
DIVIDE ( _maxyear - _minyear, ABS ( _minyear ) ) + 0
)
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , based on what I got. Force the range again
example
0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))
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 |
---|---|
46 | |
26 | |
21 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
45 | |
15 | |
12 |