Forum Discussion
Merge queries in different format
- 8 years ago
Hi cocomy,
I was abble to replicate your information follow the steps below:
- Create a new table Branchd
Branch ID
Tokyo 1 Osaka 2 Nagoya 3 - Related the following tables:
- Branch - Daily Sales : relate by branch
- Branch - Daily forecast: relate by branch
- Calendar - Daily Sales: relate by Date
- Create the measure below:
Measure created on Daily Forecast Table Daily Forecast Total = VAR Select_Month = MAX ( Calendar[Monthly Date] ) RETURN CALCULATE ( SUM ( 'Daily Forecast'[Daily Forecast] ); 'Daily Forecast'[Monthly Date] = Select_Month ) Measure created on Daily Sales Table Actual totals = SUM('Daily Sales by branch'[Actual])- Make your table visual with the following columns / measures:
- Date (Calendar Table)
- Branch (Branch Table)
- Actuals totals (measure)
- Daily Forecast Total (measure)
As you can see the result is what you need to have, I have calculated measure because if you need you can calculate differences and percentages over objective.
Here is a link to PBIX file with the examples and measures.
Regards,
MFelix
- 8 years ago
Thank you very much for detailed explanation. It is what I have been looking for ages.
All the best,
coco
Hi cocomy,
I was abble to replicate your information follow the steps below:
- Create a new table Branchd
Branch ID
| Tokyo | 1 |
| Osaka | 2 |
| Nagoya | 3 |
- Related the following tables:
- Branch - Daily Sales : relate by branch
- Branch - Daily forecast: relate by branch
- Calendar - Daily Sales: relate by Date
- Create the measure below:
Measure created on Daily Forecast Table
Daily Forecast Total =
VAR Select_Month =
MAX ( Calendar[Monthly Date] )
RETURN
CALCULATE (
SUM ( 'Daily Forecast'[Daily Forecast] );
'Daily Forecast'[Monthly Date] = Select_Month
)
Measure created on Daily Sales Table
Actual totals = SUM('Daily Sales by branch'[Actual])
- Make your table visual with the following columns / measures:
- Date (Calendar Table)
- Branch (Branch Table)
- Actuals totals (measure)
- Daily Forecast Total (measure)
As you can see the result is what you need to have, I have calculated measure because if you need you can calculate differences and percentages over objective.
Here is a link to PBIX file with the examples and measures.
Regards,
MFelix
- cocomy8 years agoResolver I
Thank you very much for detailed explanation. It is what I have been looking for ages.
All the best,
coco