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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Revenue YTD variance per category

Hi everyone,

 

I have a table with orderlines;

Orderline ID Order ID Date Cust. Nr. Value

111/1/2019460
211/1/2019436
322/1/20193140

 

I also have a table with customer information;

Cust. nr. Cust. name Category

3Potato farmerAgriculture
4Microsoft

Software

 

What I want is to calculate the variance in revenue between the different categories between current YTD vs last year YTD. I have the calculation for the total variance, however I can't split this up in categories.

How do I fix this? Do I need to change my DAX calculation?

 

Revenue YTD € = TOTALYTD(SUM('Ordertable'[Value]; 'Ordertable'[Date])
Revenue YTD € Last Year = CALCULATE([Revenue YTD €]; SAMEPERIODLASTYEAR('Ordertable'[Date]))
Variance Revenue % = [Revenue YTD €]/[Revenue YTD € Last Year]-1
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, I create sample data to test the scenario. You can create new calendar table Date, and then create relationship with the table Ordertable.

 

Date = CALENDARAUTO()

 

Then, you can create measures.

 

Revenue YTD € = TOTALYTD(SUM('Ordertable'[Value]),'Date'[DateKey])

 

Revenue YTD € Last Year = CALCULATE(SUM(Ordertable[Value]),SAMEPERIODLASTYEAR('Date'[DateKey]))

 

Choose table visual to display the result which show the variance in revenue between the different categories between current YTD vs last year YTD.

 

3.png 

 

 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ES__PrNFUQhLtaXZV7KIIG4BsV4yZaC2dHry2PLIEXZQHw?e=yOJf1q

 

Best Regards,

Amy

 

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

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, I create sample data to test the scenario. You can create new calendar table Date, and then create relationship with the table Ordertable.

 

Date = CALENDARAUTO()

 

Then, you can create measures.

 

Revenue YTD € = TOTALYTD(SUM('Ordertable'[Value]),'Date'[DateKey])

 

Revenue YTD € Last Year = CALCULATE(SUM(Ordertable[Value]),SAMEPERIODLASTYEAR('Date'[DateKey]))

 

Choose table visual to display the result which show the variance in revenue between the different categories between current YTD vs last year YTD.

 

3.png 

 

 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ES__PrNFUQhLtaXZV7KIIG4BsV4yZaC2dHry2PLIEXZQHw?e=yOJf1q

 

Best Regards,

Amy

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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