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

Need help to get the current year ,previous year total columns next to the months columns in matrix

Hi Everyone, Need your help to fullfill the requirment

I have  requirment like below 

Need to show the matrix  - columns as months data and also the FY totals dynamically,rows are countries  and the values are sales revenu.so need your help how to add FY totals dynamically( the FY start JAn and ends Dec)

CountryFY -19 TotalFY-20 TotalTotal(Fy19 + FY20)June-19July 19Aug-19sep-19Oct-19N0v-19Dec-19Jan-20Feb-20Mar-20Apr-20May-20June-20July-20
INDIA3502806302030405060708010203040506070
US3602906503030405060708020203040506070
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if you looking for this year vs Last year vs FY, you can use datesytd with date calendar and  year end date

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

refer

https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

 

But if want a hybrid display, I logged a Idea, vote for that

Hybrid.png

 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/39773011-hybrid-table

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

 

 

Anonymous
Not applicable

@amitchandak  thank you very much for your prompt reposnea and i really appreciate your help!

 I want to add the columns FY19 ,FY20 Total (FY19+Fy20) Columns in the same Matrix tablefollowing with Month's data 

 

CountryFY 19 TotalFY20 TotalTotal(Fy19 + FY20)June-19July 19Aug-19sep-19Oct-19N0v-19Dec-19Jan-20Feb-20Mar-20Apr-20May-20June-20July-20
INDIA3502806302030405060708010203040506070
US3602906503030405060708020203040506070
                  
                  
                  
                  
                  
                  
                  

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.