- 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
Need help with slicer selection dax
Hi every one
I have a slicer with the years 2022, 2023, and 2024, and I'm tracking the total price as a key performance indicator (KPI). When I select 2023 in the slicer, I want to see the total price for both 2022 and 2023. Similarly, if I select 2024, I want to see the total price for 2022, 2023, and 2024.
How can I set this up?
and also if i have financial year (2023-24) instead of year how can i do it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @v-tianyich-msft
if we have two slicers like year and month then how can i achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
This can be accomplished by making simple changes to his expression.
TotalSum = CALCULATE(SUM('Table'[Value]),'Table'[Date].[Year]<=SELECTEDVALUE('Table'[Date].[Year])&&'Table'[Date].[Month]<=SELECTEDVALUE('Table'[Date].[Month]))
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
Disconnecting dimyear from date seems to work.
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
Create a year dimension table and use it as a slicer to control the current year versus the previous year that needs to be calculated. Please see the attachment above.
Best regards,
Community Support Team_ Scott Chang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @v-tianyich-msft
The current Dax is currently operational, but the pre-Dax is not working. Also, I want data from all previous years, not just last year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So if I understand your requirements correctly on selecttion of year 2022 the output should be sum of total for year 2022,2023 & 2024. and incase of selection of 2023 the output should be a sum of total for 2023 and 2024.and there can be N number of years following the year that you select.
TotalSum = CALCULATE(SUM('Table'[Value]),'Table'[Date].[Year]>=SELECTEDVALUE('Table'[Date].[Year]))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
Please provide sample data as well as expected results.
Best regards,
Community Support Team_ Scott Chang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
Where are you stuck? What kind of results are you getting?
Best regards,
Community Support Team_ Scott Chang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ajet-p_91 ,
If only one measure is used, it seems that it is only possible to realize the totals for viewing two years. It could be last year or any span of years. You can check the results below:
Current = CALCULATE(SUM('Date'[Value]),FILTER('Date',YEAR('Date'[Date])=SELECTEDVALUE('Dim Year'[Year])))
Pre = CALCULATE(SUM('Date'[Value]),FILTER('Date',YEAR([Date])=SELECTEDVALUE('Dim Year'[Year])-1))
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
08-21-2024 01:50 PM | |||
10-07-2024 07:16 AM | |||
05-11-2024 12:02 AM | |||
07-25-2024 05:45 AM | |||
11-22-2024 08:05 AM |
User | Count |
---|---|
29 | |
16 | |
14 | |
13 | |
13 |