Forum Discussion
YTD without a date column
Hi all,
I need help with creating a measure which will give me the YTD value without a date column.
I have a measure which calculates the budget per category
- Anonymous5 years ago
You can create a separate distinct table to use the period as the slicer, then create a measure to get expected value.
Period = DISTINCT('Table'[Period])Measure = CALCULATE(SUM('Table'[Budget Value]),FILTER(ALLSELECTED('Table'),[Category]=MAX([Category]) && [Period]<=SELECTEDVALUE(Period[Period])))Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
4 Replies
- FarhanAhmed
Community Champion
Can you please share some sample data for your requirement along with desired results?
- yaman123
Post Partisan
Hi FarhanAhmed
I am hoping this makes sense.
In yellow is what i expect. It should give me the YTD total per category when i select a account period from a slicer. E.g if i select account period 4, the total for consultancy is 600 and for IT costs is 120000.
- FarhanAhmed
Community Champion
Try something like this.
_YTD = CALCULATE(SUM('YTD'[Budget]),FILTER(ALLEXCEPT('YTD','YTD'[Category]),'YTD'[PeriodID]<=MAX('YTD'[PeriodID])))
- AnonymousNot applicable
You can create a separate distinct table to use the period as the slicer, then create a measure to get expected value.
Period = DISTINCT('Table'[Period])Measure = CALCULATE(SUM('Table'[Budget Value]),FILTER(ALLSELECTED('Table'),[Category]=MAX([Category]) && [Period]<=SELECTEDVALUE(Period[Period])))Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.