cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ogend
Helper I
Helper I

Measure: Amount for All Future Years

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!

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

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

yingyinr_0-1654851521454.png

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 )
    )

yingyinr_1-1654851552734.png

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
ogend
Helper I
Helper I

@yingyinr Thank you!

amitchandak
Super User
Super User

@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()) )



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

@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

yingyinr
Community Support
Community Support

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

yingyinr_0-1654851521454.png

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 )
    )

yingyinr_1-1654851552734.png

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors