March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Guys,
Hopefuly this is an easy question:
I have a fact table with 'Amount' and 'DueDate' columns.
I created a calendar table , linked Calendar[Date] with the FactTable[DueDate] and I am using Calendar[Year] as a report slicer. I want to have two columns in a matrix report: 'Due this year' (based on slicer selection) and 'due All future years' (relative to slicer selection).
I am struggling with "All Future Years". I belive i have to use All (Calendar[Date] ) to get rid of the year slicer context and then filter on something like Calendar[Date] > Lastdate of the year selected through the slicer, but I had no luck figuring out the syntax.
Can you please help?
Thank you!
Solved! Go to Solution.
Hi @ogend ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Delete the relationship between Calendar and Facttable
2. Create a measure as below:
Amount for All Future Years =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Date].[Year] )
RETURN
CALCULATE (
SUM ( 'FactTable'[Amount] ),
FILTER ( 'FactTable', YEAR ( 'FactTable'[DueDate] ) > _selyear )
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
@ogend ,based on what I got
Do not take any date filter, you can have a measure like
Calculate(sum(Table[Amount]), filter('Date', 'Date'[Date] > today()) )
@amitchandak , thank you, but I'd need future years relative to the year selected by the year slicer( calendar table) , not the actual future relative to today(). If I select 2022 to be "the year', it should be 2023 and everything after, but if I select 2010 in the slicer, it should be years equal or larger than 2011
Hi @ogend ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Delete the relationship between Calendar and Facttable
2. Create a measure as below:
Amount for All Future Years =
VAR _selyear =
SELECTEDVALUE ( 'Calendar'[Date].[Year] )
RETURN
CALCULATE (
SUM ( 'FactTable'[Amount] ),
FILTER ( 'FactTable', YEAR ( 'FactTable'[DueDate] ) > _selyear )
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |