Combine two measures into one measure by date

Hello EDNA - looking for assistance w/ combining two measures into one measure by date.

I have two different data sets and the only thing these two tables have in common is the date table.

one set of data captures old (legacy data) from 1/1/2019 to 9/30/2021. measure ASF-OLD.

the 2nd data set captures 10/1/2021 to present. measure ASF-NEW.

I’m looking to combine both measure into one so that I can place them on a chart to show not only the numbers by the % change over time.

the ASF-OLD-N-NEW was my attempt to combine both to these measures.

please see attached sample data

image
SamplePBI.pbix (210.8 KB)

Thanks for your time in advance.

You could add a the date switchover as a parameter and then use Switch or OR statement
Calculated column > MAX(parameter Date) then measure else other measure

cmalone - thanks for the reply. what would your suggestions look like ?

This measure gives me what I’m looking for , month to month. But the TOTAL is wrong.

ASF-OLD-N-NEW (sum) = [ASF-NEW]+[ASF-OLD]

image

Hi @Frankee ,

Totals are sometimes wrongly calculated in Power BI as context is missing for the formulas used, see also the clear explanation of Greg Philps below.

A way to fix the totals in this example using “[ASF-NEW]+[ASF-OLD]” is extending the formula as follows:

ASF Old-n-new (correct total avg on monthly base) = AVERAGEX( VALUES(‘Calendar’[YrMo]), [ASF-NEW] + [ASF-OLD])

which forces the average calculation per each YrMo, and calculates the average of eight YrMo values as result in the total (see also GREEN in forelast column in the picture below)

Be aware that the total presented is an average of averages, which is completely different from a Weighted Average calculation

The totals of ASF-OLD and ASF-NEW are also not correct (see RED in first and third column), and are corrected with the similar formula as above, which give the average of the averages of the four months (GREEN in second and fourth column in picture below)

ASF-New (correct total avg) = AVERAGEX( values(‘Calendar’[YrMo]), [ASF-NEW] )

The average of the total could also be calculated by forced averaging each day (most detailed average possible), which give a different average (in this example based upon 174 daily figures instead of the 8 average monthly figures) (see BLUE in the last column) , using the following formula:

ASF Old-n-new (correct total avg on daily base) = AVERAGEX( ‘Calendar’, [ASF-OLD] + [ASF-NEW] )

PBIX attached:
SamplePBI v2.pbix (229.4 KB)

P.S. Recommended is to merge the tables OLD and NEW in Power Query, with adding a column for the versions, as the data structure (headers) are exactly the same, which reduces the required measures significantly (avoid doubling measures).

Please look for a clear detailed explanation about fixing totals to the post of Greg Philps:

I hope this answers your question,

Kind regards, Jan van der Wind

1 Like

Thank you Jan! Looks to be working. I’ll be reviewing the suggestions you mentioned. pointing out the weighted avg. will have me dig a bit deeper.

1 Like

Good to see that you are making progress with you inquiry @Frankee.

Kindly take time to answer the Enterprise DNA Forum User Experience Survey, we hope you’ll give your insights on how we can further improve the Support forum. Thanks!

Hello @Frankee, it’s been a while since we got a response from you.

Just following up if you still need help with your inquiry?

If you do, kindly provide the information the experts requested above so they can help you further.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.