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

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