Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi everyone,
I have a table with orderlines;
Orderline ID Order ID Date Cust. Nr. Value
1 | 1 | 1/1/2019 | 4 | 60 |
2 | 1 | 1/1/2019 | 4 | 36 |
3 | 2 | 2/1/2019 | 3 | 140 |
I also have a table with customer information;
Cust. nr. Cust. name Category
3 | Potato farmer | Agriculture |
4 | Microsoft | 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?
Solved! Go to Solution.
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.
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.
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
72 | |
62 | |
51 | |
48 |
User | Count |
---|---|
206 | |
90 | |
61 | |
59 | |
57 |