Forum Discussion
PY Period figure
Hi Krisso1975 ,
What is this [uvw Period Details.Current] column? Is it a column to identify if the records is current or last year?
Regardless this column, If you have date column, you could use year([date]) to get the year of date and year([date])-1 to get last year.
So the measure shoule be like:
last year =
CALCULATE (
SUM ( 'Table'[value] ),
FILTER (
ALLSELECTED ( 'Table' ),
YEAR ( 'Table'[date] )
= YEAR ( SELECTEDVALUE ( 'calendar'[date] ) ) - 1
)
)
If I misunderstood your meaning, please show some sample data and expected result.
Best Regards,
Jay
Hi Jay,
In power query I have a table of period details that is merged in with the data i am using Current is a reference to if todays date falls between the 1st of the month and last of the month = Table.AddColumn(#"Changed Type1", "Current", each if([Current Date] >= [PeriodStartDate]) and([Current Date]<=[PeriodEndDate]) then "Current" else "Previous") which then I use to pull the current periods data.
I tried your solution but got a blank result. I this something I could similar in power query to find the same period 1 year back rather than doing through Power BI measures?