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.
I have custom field in my slicer for FY19,FY20,F21 coming from the date table and I need to use SamePeriodLastYear in the calculation, but keep filtering by my slicer above.
Because I'm not using the date field on the slicer the calculation isn't working.
Any ideas how to fix?
please see below :
Thanks
Solved! Go to Solution.
Hi, @Anonymous
Just in case, please check if your DimDateTable is assigned as a date-table.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
Hi, @Anonymous
Just in case, please check if your DimDateTable is assigned as a date-table.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
Hi,
Thanks for that.
The table actually wans't assiged as Data because I had one gap between the dates.
I remove the first row which was the gap from 01/01/1900 then Assiged again as date table and now it's working.
Thanks a lot.
@Anonymous , I am not sure about the need on hasonevalue here.
isfiltered or isinscope are better alternates
Invoiced Revenue PY =
var result =
CALCULATE( [Invoiced Revenue],
SAMEPERIODLASTYEAR(DimDate[Date])
)
RETURN
IF(
isinscope(DimDate[Financial_Year_short]),
result, 0
)
or simply use
Invoiced Revenue PY =
CALCULATE( [Invoiced Revenue],
SAMEPERIODLASTYEAR(DimDate[Date])
)
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Other than there can a few other reasons Time intelligence can fail
Hi,
Thanks for getting back to me.
But still not working. Forget about the is in scope, if I only use the sameperiod last year also is not working.
For some reason the calculation only works when I the column with Financial_year_short is not in the visual.
See below:
When I aggregate with the column I need, it's weird because it shows me the total only.
Now without the Financial Year Short (column I need to aggregate the PY values)
The issue is when I bring the Financial_year_short that I need.
This columns is a simple column from the date table saying which fiscal year is the date.
User | Count |
---|---|
82 | |
81 | |
37 | |
34 | |
32 |
User | Count |
---|---|
94 | |
80 | |
60 | |
50 | |
49 |