Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculating FULL YEAR SUM value with slicer on month

Hello PowerBI Community,

 

I'm struggling with calculating sum of FULL YEAR when slicer on Month is applied.

I have a table like that:

PBI.PNG

 

Now I would like to have a slicer on MONTH and calculate sum of FULL YEAR, for example:
Slicer Month: 2019-05

Sales Amount: 300

Sales Amount PY: 150

Sales Amount FULL YEAR: 2700 (sum of Sales Amount for 2019 = Sales Amount YTD for 2019-12)

Sales Amount PY FULL YEAR: 2550 (sum of Sales Amount PY = Sales Amount YTD PY for 2019-12)

 

How can I achieve it?

I tried using ALL() function but then it calculate sum of all years not only for 2019.

Then I wanted to restrict and filter only 2019 data, but how can I get correct year (it should be the year from month slicer)? I can not hardcode it - I want to be able to select for example 2018-07, and so on...

 

Do you have any ideas?

 

Thanks,

Best regards,

S. (:

2 REPLIES 2
vanessafvg
Super User
Super User

@Anonymous  can you paste some data in text form?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

@vanessafvg

 

YearMonthSales AmountSales Amount PYSales Amount YTDSales Amount YTD PY
20181150200150200
20182150250300450
20183250150550600
20184300200850800
2018515030010001100
2018620035012001450
2018725025014501700
2018815010016001800
2018925010018501900
20181035010022002000
20181150020027002200
20181230035030002550
20191100150100150
20192200150300300
20193150250450550
20194250300700850
2019530015010001000
2019620020012001200
2019710025013001450
2019810015014001600
2019920025016001850
20191025035018502200
20191135050022002700
20191250030027003000

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.