cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anno2019
Helper III
Helper III

Create Table split by month & Show Variance and totals

Hi PBI Guru's

 

I need some assistance, please.  This is such an easy task in excel but I just cannot get it right in PBI.

Below is a screenshot of the desired result.  I have also included a link to the pbix file for ease of reference.

 

Can anyone figure this out?  Would really appreciate it.

Also, YTD in my world means -1 month.  So as of today, the month is Aug, so my YTD would be Jan to July.

p.s the figures in the screenshot will not match the pbix file it was made for reference purposes only.

Variance table.JPG

 

 

 

 

https://www.dropbox.com/s/08b8rj1qxffectn/Testing%20Visual%20monthly.pbix?dl=0 

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @Anno2019 ,

 

You can create a calculated table to get the calendar table first of all , then create relationship between your 'Shipment Level Data' table and the calendar table on date column. Secondly , create YTD measures like DAX below:

 

CalendarTable= CALENDARAUTO()
 
CurrentYear_YTD= CALCULATE(SUM('Shipment Level Data'[Profit]),FILTER(ALLSELECTED('Shipment Level Data'),'Shipment Level Data'[Year]=MAX('Shipment Level Data'[Year])&&'Shipment Level Data'[Month]=MAX('Shipment Level Data'[Month])-1))
 
LastYear_YTD= CALCULATE([CurrentYear_YTD],DATEADD(CalendarTable[Date],-1,YEAR))
 
Variance= [CurrentYear_YTD]-[LastYear_YTD]

Best Regards,

Amy

 

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

@v-xicai  Thank you, that would sort out the YTD Total but how would I go about building the table to look like the one I need?

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors