- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Running total for last year
Hi Team,
I have a table with the data as below. I have calculated the current year count and running total for current year. however, finding it difficult to calculate the same for last year. I cant use "sameperiodlastyear" or any other date functions because we dont have date column. all we have is Type column which has data as below . So I'm calculating the lastyear/period as below
Type:
XYZ - Q1-2021 |
XYZ - Q1-2022 |
XYZ - Q1-2023 |
XYZ - Q2-2021 |
XYZ - Q2-2022 |
XYZ - Q2-2023 |
XYZ - Q3-2021 |
XYZ - Q3-2022 |
XYZ - Q3-2023 |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Team,
Thanks for your responses. I agree and love the date table all the time. As I said I couldnt add the DateTable due to different dates for different Types. So I finally was able to do it by creating a supporting column as below.
I found that we have start date and end date and based on these columns I created a column
"DayCount = EndDate - Startdate "
which gave the output as 1,2,3 and so on.... then I based the maxdate variable based on this and
So my final query now looks like which worked in my situation:
Lastyear1 =
thanks everyone for helping me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Team,
Thanks for your responses. I agree and love the date table all the time. As I said I couldnt add the DateTable due to different dates for different Types. So I finally was able to do it by creating a supporting column as below.
I found that we have start date and end date and based on these columns I created a column
"DayCount = EndDate - Startdate "
which gave the output as 1,2,3 and so on.... then I based the maxdate variable based on this and
So my final query now looks like which worked in my situation:
Lastyear1 =
thanks everyone for helping me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

HI @LP280388,
I'm glad to hear you find the solution and share the formula here, they should help others who faced the similar scenario.
Regards,
Xiaoxin Sheng
If this post helps, please consider accept as solution to help other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @LP280388,
Time intelligence function requirement a calendar table with general date values.
According to your description, it seems like you are used the text date values which not supported in time intelligence functions.
For this scenario, I'd like to suggestion add a calculated column to convert the value to date values, then you can use DATE function to extract this value parts as condition to filter date ranges in your expressions.
Regards,
Xiaoxin Sheng
If this post helps, please consider accept as solution to help other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

That's not sustainable. Add a calendar table to your data model, and add a date column to your fact table.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
11-05-2024 03:43 PM | |||
04-01-2024 08:06 AM | |||
10-05-2024 12:49 AM | |||
10-15-2024 11:40 PM | |||
Anonymous
| 06-13-2024 01:16 AM |
User | Count |
---|---|
136 | |
107 | |
86 | |
58 | |
46 |