Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi @Mike22 ,
The key point here should be a slicer table without relating to the fact table. Then we can create a measure like this to the excepted KPI.
Measure =
VAR this_year =
YEAR ( TODAY () ) - 1
VAR countr =
COUNTROWS ( Slicer )
VAR sele =
SELECTEDVALUE ( Slicer[Submission date] ) - 1
RETURN
IF (
countr = 1,
CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', 'Table'[Year] = sele ) ),
IF (
countr > 1,
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( 'Table', 'Table'[Year] = this_year )
)
)
)
Thank you for the quick reply. Just a few clarifications please.
VAR countr =
COUNTROWS ( Slicer )What is slicer supposed to be? The current slicer is currently derived from the travel submission date.
Let me just show you how the data is structured
| trip number | trip start date | trip end date | submission date |
| 1 | 01/02/2019 | 05/02/2019 | 25/01/2019 |
| 2 | 06/06/2018 | 08/06/2018 | 04/05/2018 |
| 3 | 08/08/2018 | 11/08/2018 | 30/07/2018 |
| 4 | 06/09/2017 | 18/09/2017 | 08/08/2017 |
If submission year selected is 2018 the count for 2018 will be 2 (this is in the measure I shared with you). I need a measure that will calculate 2017 when 2018 is selected. If 2018 and 2017 are selected it will count 2018 as it is current year (2019)-1.
The count is done based on the "trip start date column" not the submission date. So if a trip is submitted in 2018 and start date in 2019 it will count against the 2019 data.
Hope this helps and thanks again.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 43 | |
| 30 | |
| 24 |