Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217097

Calculate average of month-on-month percentage, for all categories, same date

$
0
0

Hi,

 

A "simplified" version of my problem, which consists of 3 columns, namely CATEGORY, DATE, VALUE

 

Sample RAW DATA

 

raw.JPG

 

My goal is to get : Average of month-on-month percentage for category A and B, for each row (DATE in my case)

 

final.JPG

 

----------------------------------------------------------------

 

This is what I have achieved so far. The table below is not my final goal. The final goal is the table above, as noted.

 

(Please note the "DATE[Date]" column below is from lookup calendar table, with relationship.)

 

SUM = SUM ( MYTABLE[VALUE] )
MoM% = 
VAR Last = [SUM]
VAR First = CALCULATE ( [SUM], DATEADD ( 'DATE'[Date], -1, DAY ) )

RETURN
100 * ( Last / First - 1 )

 

MID.JPG

 

The real life problem requires me to get weighted average of data (vs simple average here), and for more than 20 different data in CATEGORY column (vs only two data here, namely A and B). I simplify the problem jz to make your life easy. Many thanks !!


Viewing all articles
Browse latest Browse all 217097

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>