Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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!
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
11 | |
7 |