Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
zerosugar
Helper II
Helper II

Can I append a subset of table rows back to the table itself, multiple times?

Hi all,

 

I'm having some trouble with something that I'd like to do. Essentially I have a dataset that consists of multiple Revenue Forecasts, along with Actual values for those forecasts. The Actual values are updated as time goes on. Same goes for the Forecasts. The data looks something like this:

 

Jump Off DateRevenue DateForecast NameBusiness DivisionRevenue
 3/31/2019ActualsManagement Consulting206
 6/30/2019ActualsManagement Consulting144
 9/30/2019ActualsManagement Consulting275
 12/31/2019ActualsManagement Consulting103
 3/31/2020ActualsManagement Consulting288
 6/30/2020ActualsManagement Consulting151
 3/31/2019ActualsTech Consulting97
 6/30/2019ActualsTech Consulting81
 9/30/2019ActualsTech Consulting61
 12/31/2019ActualsTech Consulting70
 3/31/2020ActualsTech Consulting74
 6/30/2020ActualsTech Consulting65
9/30/20199/30/2019Q3 2019 Optimistic ForecastManagement Consulting275
9/30/201912/31/2019Q3 2019 Optimistic ForecastManagement Consulting103
9/30/20193/31/2020Q3 2019 Optimistic ForecastManagement Consulting288
9/30/20196/30/2020Q3 2019 Optimistic ForecastManagement Consulting151
9/30/20199/30/2020Q3 2019 Optimistic ForecastManagement Consulting251
9/30/201912/31/2020Q3 2019 Optimistic ForecastManagement Consulting294
9/30/20199/30/2019Q3 2019 Optimistic ForecastTech Consulting97
9/30/201912/31/2019Q3 2019 Optimistic ForecastTech Consulting81
9/30/20193/31/2020Q3 2019 Optimistic ForecastTech Consulting61
9/30/20196/30/2020Q3 2019 Optimistic ForecastTech Consulting70
9/30/20199/30/2020Q3 2019 Optimistic ForecastTech Consulting148
9/30/201912/31/2020Q3 2019 Optimistic ForecastTech Consulting138
9/30/20199/30/2019Q3 2019 Stress ForecastManagement Consulting275
9/30/201912/31/2019Q3 2019 Stress ForecastManagement Consulting103
9/30/20193/31/2020Q3 2019 Stress ForecastManagement Consulting288
9/30/20196/30/2020Q3 2019 Stress ForecastManagement Consulting151
9/30/20199/30/2020Q3 2019 Stress ForecastManagement Consulting158
9/30/201912/31/2020Q3 2019 Stress ForecastManagement Consulting150
9/30/20199/30/2019Q3 2019 Stress ForecastTech Consulting97
9/30/201912/31/2019Q3 2019 Stress ForecastTech Consulting81
9/30/20193/31/2020Q3 2019 Stress ForecastTech Consulting61
9/30/20196/30/2020Q3 2019 Stress ForecastTech Consulting70
9/30/20199/30/2020Q3 2019 Stress ForecastTech Consulting33
9/30/201912/31/2020Q3 2019 Stress ForecastTech Consulting47

 

 

Here's an example of a visual I want to see:


test_pic.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What I want is 2 things: 

1. Where "Actuals" values overlap with the Q3 2019 Optimistic and Stress Forecast, the "Actual" values should not appear. I just want to show the Forecast values. It's also important to note that the Forecasts (I'll always only want to look at two at once) may not have the same jump-off/start quarters. One forecast could start Q3 2019 and another could start Q4 2019. 

 

2. Where the value is just "Actuals" I'd like to somehow "duplicate" that and have one of them become "Q3 2019 Optimistic Forecast" and the other become "Q3 2019 Stress Forecast". Basically I need to do this so I can show to full year 2019 combined actual/forecast of both Q3 2019 Optimistic Forecast and Q3 2019 Stress Forecast. These forecasts names will change in the future. 

 

So essentially I need to append the "Actuals" time series data to the beginning of each Forecast for each Business Division. And I need to make sure the name of that appended data in the [Jump Off Name] column is the same as the Forecast name to which it was appended. 

 

How would I do something like this? I've been spinning my wheels on this trying to get something going, but I'm not making any progress. All I can think to do is use the CROSSJOIN() function, but I'm not sure how to build on that. Does anyone have any tips?

 

Any help would be greatly appreciated. Thank you!

5 REPLIES 5
lbendlin
Super User
Super User

You would use a disconnected dates table with the quarters,  cross join that with the Consulting types, and then create two measures  (optimistic/stress) that would calculate according to your rules.

 

Is this sufficient or do you need to see a sample implementation?

Hi, thank you for the reply! I appreciate the help very much. Is it possible you can provide a sample implementation? I'm having some trouble with this. I've done this so far:

 

The tables: 

All tablesAll tables

 

Date Table of unique revenue dates:

 All unique revenue dates (will this be problematic with multiple unique jump-off dates?)All unique revenue dates (will this be problematic with multiple unique jump-off dates?)

 

Cross-joining the dates table values with the forecast names:

Crossjoining the revenue dates with the jump off namesCrossjoining the revenue dates with the jump off names

 

The base data table:

Total DataTotal Data

 

A waterfall chart visual I'd like to show Q1 and Q2 actuals as a part of. 

Waterfall chart visual - I'd like to grab the Q1 and Q2 2019 values from actuals and add them to both the optimistic and the stress forecast. Q3 from Actuals is equal to both forecast Q3's so we don't need it.Waterfall chart visual - I'd like to grab the Q1 and Q2 2019 values from actuals and add them to both the optimistic and the stress forecast. Q3 from Actuals is equal to both forecast Q3's so we don't need it.

For the waterfall chart, I want Q1 and Q2 actuals to be appended to both the Optimistic and Stress forecast. Ideally, I'd like for this not to be hardcoded, because the jump-off quarter will change frequently. I just wantthere to be some sort of formula that fills missing quarterly values for the year with values from the "Actuals" jump off name. That way all values are represented and we get an apples-to-apples comparison. 

 

In the future, I may compare a Q2 2019 Optimistic Forecast to a Q4 2019 Optimistc Forecast. So, if I add Q1 actuals to the first one, and Q1, Q2, and Q3 actuals to the second one, it's more of an apples-to-apples forecast. It might also be okay to just compare values for dates that overlap between the selected forecast dates, but I think showing full year with the help of actuals is a better view.

 

Is this possible? I'm not sure how to do this in DAX. I'd appreciate any insight you can provide. Thank you!

Please provide your sample data in usable format.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

Here's the dataset that I'm using. I've added an Optimistic and Stress Forecast for Q2 2019 Jump Off as well, so that I can ensure functionality when comparing different jump-off dates. 

 

 

Jump Off DateRevenue DateForecast NameBusiness DivisionRevenue
 3/31/2019ActualsManagement Consulting118
 6/30/2019ActualsManagement Consulting174
 9/30/2019ActualsManagement Consulting210
 12/31/2019ActualsManagement Consulting225
 3/31/2020ActualsManagement Consulting299
 6/30/2020ActualsManagement Consulting123
 3/31/2019ActualsTech Consulting83
 6/30/2019ActualsTech Consulting72
 9/30/2019ActualsTech Consulting82
 12/31/2019ActualsTech Consulting68
 3/31/2020ActualsTech Consulting99
 6/30/2020ActualsTech Consulting54
9/30/20199/30/2019Q3 2019 Optimistic ForecastManagement Consulting210
9/30/201912/31/2019Q3 2019 Optimistic ForecastManagement Consulting293
9/30/20193/31/2020Q3 2019 Optimistic ForecastManagement Consulting67
9/30/20196/30/2020Q3 2019 Optimistic ForecastManagement Consulting273
9/30/20199/30/2020Q3 2019 Optimistic ForecastManagement Consulting327
9/30/201912/31/2020Q3 2019 Optimistic ForecastManagement Consulting479
9/30/20199/30/2019Q3 2019 Optimistic ForecastTech Consulting83
9/30/201912/31/2019Q3 2019 Optimistic ForecastTech Consulting106
9/30/20193/31/2020Q3 2019 Optimistic ForecastTech Consulting131
9/30/20196/30/2020Q3 2019 Optimistic ForecastTech Consulting172
9/30/20199/30/2020Q3 2019 Optimistic ForecastTech Consulting132
9/30/201912/31/2020Q3 2019 Optimistic ForecastTech Consulting165
9/30/20199/30/2019Q3 2019 Stress ForecastManagement Consulting210
9/30/201912/31/2019Q3 2019 Stress ForecastManagement Consulting70
9/30/20193/31/2020Q3 2019 Stress ForecastManagement Consulting2
9/30/20196/30/2020Q3 2019 Stress ForecastManagement Consulting215
9/30/20199/30/2020Q3 2019 Stress ForecastManagement Consulting21
9/30/201912/31/2020Q3 2019 Stress ForecastManagement Consulting202
9/30/20199/30/2019Q3 2019 Stress ForecastTech Consulting83
9/30/201912/31/2019Q3 2019 Stress ForecastTech Consulting32
9/30/20193/31/2020Q3 2019 Stress ForecastTech Consulting18
9/30/20196/30/2020Q3 2019 Stress ForecastTech Consulting16
9/30/20199/30/2020Q3 2019 Stress ForecastTech Consulting2
9/30/201912/31/2020Q3 2019 Stress ForecastTech Consulting96
6/30/20196/30/2019Q2 2019 Optimistic ForecastManagement Consulting174
6/30/20199/30/2019Q2 2019 Optimistic ForecastManagement Consulting234
6/30/201912/31/2019Q2 2019 Optimistic ForecastManagement Consulting53
6/30/20193/31/2020Q2 2019 Optimistic ForecastManagement Consulting218
6/30/20196/30/2020Q2 2019 Optimistic ForecastManagement Consulting262
6/30/20199/30/2020Q2 2019 Optimistic ForecastManagement Consulting384
6/30/20196/30/2019Q2 2019 Optimistic ForecastTech Consulting174
6/30/20199/30/2019Q2 2019 Optimistic ForecastTech Consulting84
6/30/201912/31/2019Q2 2019 Optimistic ForecastTech Consulting105
6/30/20193/31/2020Q2 2019 Optimistic ForecastTech Consulting138
6/30/20196/30/2020Q2 2019 Optimistic ForecastTech Consulting106
6/30/20199/30/2020Q2 2019 Optimistic ForecastTech Consulting132
6/30/20196/30/2019Q2 2019 Stress ForecastManagement Consulting174
6/30/20199/30/2019Q2 2019 Stress ForecastManagement Consulting56
6/30/201912/31/2019Q2 2019 Stress ForecastManagement Consulting2
6/30/20193/31/2020Q2 2019 Stress ForecastManagement Consulting172
6/30/20196/30/2020Q2 2019 Stress ForecastManagement Consulting16
6/30/20199/30/2020Q2 2019 Stress ForecastManagement Consulting162
6/30/20196/30/2019Q2 2019 Stress ForecastTech Consulting174
6/30/20199/30/2019Q2 2019 Stress ForecastTech Consulting26
6/30/201912/31/2019Q2 2019 Stress ForecastTech Consulting15
6/30/20193/31/2020Q2 2019 Stress ForecastTech Consulting13
6/30/20196/30/2020Q2 2019 Stress ForecastTech Consulting2
6/30/20199/30/2020Q2 2019 Stress ForecastTech Consulting76

 

 

This is the output graph I'm getting currently using fields from "Total_Data":

Waterfall_Chart_3.PNG

I have 2019 selected as the year in this exampe. 

 

My issue here is that the values for the Forecasts are not Full Year values, even though they could be if the Actuals are included. So, Q2 2019 Optimistic Forecast is showing Q2, Q3, and Q4 values, with Q2 being an actual value and Q3 and Q4 being forecasted (the first date in the forecast - "predicted quarter 0" - is an actual value). Q3 2019 is the same but with Q3 and Q4.

 

The issue is when I'm comparing this two forecasts, it's not really apples-to-apples, because they don't compare the same quarters. I'd like to tack the actuals (which we have for 2019) onto both of these forecasts and see what the comparison is.

 

So for Q2 2019 Optimistc Forecast, that means the value should be 924, instead of 824.

And for Q3 2019 Optimistic Forecast we should have 1137 instead of 602.

Those would be the values for 2019. 

 

It would be even better if I could tack the actuals onto partial year forecasts when Power BI knows that actuals exist for the entire year (meaning Q1, Q2, Q3, and Q4). But if Power BI recognizes that we don't have actuals for the full year such that we can get the two forecasts to have matching revenue overlap dates (for example, if we did't have any 2019 actuals, meaning Q2 2019 would exist in the Q2 Optimistic Forecast but not in the Q3 Optimistic Forecast), then it only keeps the dates that overlap. That would ensure the comparisons are always apples-to-apples, so to speak. Not sure if that would be possible though.

I think there are two avenues you could pursue.  One would be to use COALESCE to haul in actuals where they exist, and the forecast where there are no actuals. The other avenue could be to choose a different visual like (for example)  a line chart

lbendlin_0-1663527768441.png

I don't fully understand your business rules - maybe someone more versed in forecasting can chime in.

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.