Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi everyone,
I'm working with a table similar to the one below and facing a challenge in creating a measure for the last column ("Forecasted Q2"). The goal is to calculate this value based on the Product class for each product.
The main challenge is that the measure needs to:
Could anyone suggest how to write such a measure in Power BI that respects the row context but also calculates the total sum accurately?
Thanks in advance!
| Product code | Product class | Sales Q1 | Forecast approach Q2 | Forecasted Q2 |
| Product A | Focus | 100 | Q1 + 10% | 110 |
| Product B | Focus | 10 | Q1 + 10% | 11 |
| Product C | Focus | 30 | Q1 + 10% | 33 |
| Product D | Not focus | 50 | Q1 | 50 |
| Total | 190 | 204 |
Solved! Go to Solution.
Hello @apohl1,
Thank you for reaching out to the Microsoft Fabric Community Forum.
I’ve reproduced your scenario in Power BI Desktop based on the table structure and logic you shared and I was able to get the expected output, where:
I created:
Here’s the DAX measure I used to calculate Forecasted Q2:
Forecasted Q2 =
SUMX (
SalesTable,
SalesTable[Sales Q1] * RELATED(ForecastTable[Forecast Factor])
)
For your reference and testing, I’m attaching the .pbix file.
Best regards,
Ganesh Singamshetty.
Hello @apohl1,
Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.
Thank you.
Hello @apohl1,
Thank you for reaching out to the Microsoft Fabric Community Forum.
I’ve reproduced your scenario in Power BI Desktop based on the table structure and logic you shared and I was able to get the expected output, where:
I created:
Here’s the DAX measure I used to calculate Forecasted Q2:
Forecasted Q2 =
SUMX (
SalesTable,
SalesTable[Sales Q1] * RELATED(ForecastTable[Forecast Factor])
)
For your reference and testing, I’m attaching the .pbix file.
Best regards,
Ganesh Singamshetty.
Thank you! Your solution would have worked if I was able to setup a relationship between the two tables. Unfortunately, my model is more complex and it's not possible. Howerver, I managed to get to the results I wanted with the following formula:
Thank you! Sorry I should have clarified that "Forecast factor" and "Sales" are stored in two different tables. Therefore, this solution doesn't work.
I created a column [Forecast factor Q2] with the amount to multiply by Sales Q1.
Measure:
Forecasted Q2 =
SUMX ( Table1, Table1[Sales Q1] * Table1[Forecast factor Q2] )
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |