cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Day over day change

hello,

I have been stuck on this for a few days now. Could you please help me create a column to be added to the matrix to calculate the day over day change for a particular count.

 

See below. I have the dates in the column headers and counts for each of the dates below them. I want a new column to show %change of counts from previous day for each of the items in the name column. Thanks so much! 

 

sdasdasdasdas.JPG

 

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your refe rence, here we can create a measure as below.

Measure = 
VAR pred =
    MAX ( [Day ] ) - 1
VAR prev =
    CALCULATE (
        SUM ( [value] ),
        FILTER ( ALL ( Table1 ), [Day ] = pred ),
        VALUES ( Table1[Name] )
    )
VAR change =
    MAX ( [value] ) - prev
VAR Per =
    DIVIDE ( change, prev, 0 )
RETURN
    IF ( prev = 0, BLANK (), Per )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your refe rence, here we can create a measure as below.

Measure = 
VAR pred =
    MAX ( [Day ] ) - 1
VAR prev =
    CALCULATE (
        SUM ( [value] ),
        FILTER ( ALL ( Table1 ), [Day ] = pred ),
        VALUES ( Table1[Name] )
    )
VAR change =
    MAX ( [value] ) - prev
VAR Per =
    DIVIDE ( change, prev, 0 )
RETURN
    IF ( prev = 0, BLANK (), Per )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

I figured it out, except my calculation looks at day-over-day differences (not % change).

 
Followers Day over Day Change =
VAR previousWeiboday =
MAX ( Weibo[Date] ) - 1
 
VAR previousdayfollowers =
CALCULATE( SUM ( Weibo[Followers] ), Weibo[Date]=previousWeiboday)
 
VAR currentWeiboday =
max(Weibo[Date])
 
VAR currentdayfollowers =
CALCULATE(SUM(Weibo[Followers]), (Weibo[Date])=currentWeiboday)
 
RETURN
currentdayfollowers - previousdayfollowers
Anonymous
Not applicable

Hi - Thankyou so much for this. I did try this but still nt getting the anticipated results. please see below . As you can see the day over day % change is incorrect. I am wondering if its because the daily count of each of these names is not summed in the raw data. 

 

pb2.JPGpb1.JPG

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors