
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Comparison between months using set analysis
Hi everyone,
I need to create a line chart that compares each month to its previous month.
The dimension is Year-Month (format: YYYY-MM).
The metric should be the quantity of the month compared to the quantity of its previous month. There is a master measure called CountX that can be used.
For example:
The model is filtered for the year 2025.
CountX for February 2025 is 100, for January 2025 is 80, and for December 2024 is 95.
Then in January 2025 I should see -15 (80-95), and in February 2025 I should see 20 (100-80).
I tried using the Above function, but I am not getting data for January 2025, probably because December 2024 doesn't meet the filter criteria.
I couldn't solve it using set analysis.
I would appreciate any help.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Amit,
You can use the below expression. Please check if this helps.
Sum({<YearMonth>}Sales)-Below(Sum({<YearMonth>}Sales))
you can replace Sum with Count and Sales with Quantity based on your requirement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to do it.
For Above I am not getting data for March 2025.
For Below I am not getting data for January 2025.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Amit,
Can you please let me know the value should be displayed for the last month? Based on the below function, we will not get any value for the last month. Should it be the same value for the last month?
And if possible, can you please help me with the sample data?
