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
joshcomputer1
Helper V
Helper V

Rate of change from previous month

I am trying to show the % of change from one month to the next.  The table is SCCDDATA and the column is [cinum]. I have a count of each cinum called [cinum count].  I am using a date table named 'date'[date].  I want to show this in a table with the cinum as the rows and the month as the columns. Displaying the difference from the previous month. Any help is appreciated.

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @joshcomputer1,

 

Suppose your table structure is like:

1.PNG

 

Please create a calculated table using below formula:

Summarize table =
SUMMARIZE (
    SCCDDATA,
    SCCDDATA[Date].[MonthNo],
    SCCDDATA[cinum],
    "total sales"SUM ( SCCDDATA[sales] )
)

Add a calculated column:

Diff =
'Summarize table'[total sales]
    - LOOKUPVALUE (
        'Summarize table'[total sales],
        'Summarize table'[cinum], 'Summarize table'[cinum],
        'Summarize table'[MonthNo], 'Summarize table'[MonthNo] - 1
    )

2.PNG

 

Use a matrix to display data.

3.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yulgu-msft
Employee
Employee

Hi @joshcomputer1,

 

Suppose your table structure is like:

1.PNG

 

Please create a calculated table using below formula:

Summarize table =
SUMMARIZE (
    SCCDDATA,
    SCCDDATA[Date].[MonthNo],
    SCCDDATA[cinum],
    "total sales"SUM ( SCCDDATA[sales] )
)

Add a calculated column:

Diff =
'Summarize table'[total sales]
    - LOOKUPVALUE (
        'Summarize table'[total sales],
        'Summarize table'[cinum], 'Summarize table'[cinum],
        'Summarize table'[MonthNo], 'Summarize table'[MonthNo] - 1
    )

2.PNG

 

Use a matrix to display data.

3.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I created the summarized table as you described above. I am not able to enter SCCDDATA[Date].[MonthNo].  So I entered SCCDDATA[Date]. Any idea why I can't do that? 

 

Summarize table =
SUMMARIZE (
SCCDDATA,
SCCDDATA[Date],
SCCDDATA[cinum],
"CI Total", count ( SCCDDATA[cinum] )
)

 

I think this is causing issues on the Month over Month formula.  I have this, but get an error when I include .[MonthNo] on the last line. Obviously, without this, it doesn't slice by month. Any help is appreciated. 

 

Month Over Month =
'Summarize table'[CI Total]
- LOOKUPVALUE (
'Summarize table'[CI Total],
'Summarize table'[cinum], 'Summarize table'[cinum],
'Summarize table'[Date], 'Summarize table'[Date] - 1
)

Hi @joshcomputer1,

 

I guess you linked 'SCCDDATA' with a date dimension table based on [Date] field. In that case, please try this:

Summarize table =
SUMMARIZE (
    SCCDDATA,
    MONTH(SCCDDATA[Date]),
    SCCDDATA[cinum],
    "cinum count", COUNT ( SCCDDATA[cinum] )
)

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I sent you a private message with file path. Please review. 

Thanks v-yulgu-msft,

 

The original table doesn't have a count of each cinum.  There are many columns in this table and the cinum column is all text entries.  That's why I am using ci count just to get a count of each type of cinum.  Does that make a difference in the formula you presented?

 

cinum     month

a                5

b                5 

c                6

d                7

a                5 

c                8

etc...

Hi @joshcomputer1,

 

Share a sample dataset and show your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @joshcomputer1,

 

In that case, you should modify the formula for calculated table as below:

Summarize table =
SUMMARIZE (
    SCCDDATA,
    SCCDDATA[Date].[MonthNo],
    SCCDDATA[cinum],
    "cinum count", COUNT ( SCCDDATA[cinum] )
)

The rest steps are the same.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.