Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have a table with data for multiple periods and want to calculate the difference between two periods based on user selection. For example, I have a table where different sales teams update their forecasted sales each month
| Sales Team | Forecast | Forecast Date |
| Northeast | 1000 | Jan-21 |
| Southeast | 1200 | Jan-21 |
| Midwest | 800 | Jan-21 |
| Northwest | 900 | Jan-21 |
| Southwest | 700 | Jan-21 |
| Northeast | 950 | Feb-21 |
| Southeast | 1300 | Feb-21 |
| Midwest | 850 | Feb-21 |
| Northwest | 950 | Feb-21 |
| Southwest | 750 | Feb-21 |
| Northeast | 950 | Mar-21 |
| Southeast | 1250 | Mar-21 |
| Midwest | 875 | Mar-21 |
| Northwest | 900 | Mar-21 |
| Southwest | 750 | Mar-21 |
I would like to create a table where the user selects two forecast dates and the table shows the difference between those two forecasts and ONLY includes records that have a difference. For example, the output could select Mar 21 and Feb 21 and get the following output
| Forecast date 1 | Forecast date 2 | ||
| 21-Feb | 21-Mar | ||
| Sales Team | Forecast 1 | Forecast 2 | Change |
| Southeast | 1300 | 1250 | -50 |
| Midwest | 850 | 875 | 25 |
| Northwest | 950 | 900 | -50 |
Solved! Go to Solution.
Hi @jal1aaa ,
I created a sample pbix file for you, please check whether that is what you want. Please find the attachment for more details.
1. Create two dimension table: Forecast date 1 table and Forecast date 2 table using below formula and create two date slicers base on the date field in these two tables
Forecast date 1 = VALUES('Table'[Forecast Date])Forecast date 2 = VALUES('Table'[Forecast Date])
2. Create the below measures to get the forecast1, forecast2 and change
Forecast 1 =
CALCULATE (
SUM ( 'Table'[Forecast] ),
FILTER (
'Table',
'Table'[Forecast Date] = SELECTEDVALUE ( 'Forecast date 1'[Forecast Date] )
)
)Forecast 2 =
CALCULATE (
SUM ( 'Table'[Forecast] ),
FILTER (
'Table',
'Table'[Forecast Date] = SELECTEDVALUE ( 'Forecast date 2'[Forecast Date] )
)
)Change = [Forecast 1]-[Forecast 2]
3. Create a table visual and apply the visual level filter with the condition: Change is not 0 just as shown in below screenshot
Best Regards
Hi @jal1aaa ,
I created a sample pbix file for you, please check whether that is what you want. Please find the attachment for more details.
1. Create two dimension table: Forecast date 1 table and Forecast date 2 table using below formula and create two date slicers base on the date field in these two tables
Forecast date 1 = VALUES('Table'[Forecast Date])Forecast date 2 = VALUES('Table'[Forecast Date])
2. Create the below measures to get the forecast1, forecast2 and change
Forecast 1 =
CALCULATE (
SUM ( 'Table'[Forecast] ),
FILTER (
'Table',
'Table'[Forecast Date] = SELECTEDVALUE ( 'Forecast date 1'[Forecast Date] )
)
)Forecast 2 =
CALCULATE (
SUM ( 'Table'[Forecast] ),
FILTER (
'Table',
'Table'[Forecast Date] = SELECTEDVALUE ( 'Forecast date 2'[Forecast Date] )
)
)Change = [Forecast 1]-[Forecast 2]
3. Create a table visual and apply the visual level filter with the condition: Change is not 0 just as shown in below screenshot
Best Regards
@jal1aaa solution is attached, you can tweak it as you see fit.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.