Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
Hi @v-tianyich-msft
if we have two slicers like year and month then how can i achieve this
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.
This is the result
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.
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
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.
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]))
Hi @ajet-p_91 ,
Please provide sample data as well as expected results.
Best regards,
Community Support Team_ Scott Chang
Hi @ajet-p_91 ,
Where are you stuck? What kind of results are you getting?
Best regards,
Community Support Team_ Scott Chang
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
12 | |
11 | |
7 | |
7 |
User | Count |
---|---|
16 | |
13 | |
12 | |
9 | |
9 |