cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
weixiangzhang Frequent Visitor
Frequent Visitor

Best way to make a column of week over week percent change?

I was able to make a measure that shows the sum of a total for previous week, but however I want to utilize the percent column into it's own column so I can use the slicer for percent change. Any way of doing a new measure column of previous week totals?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
weixiangzhang Frequent Visitor
Frequent Visitor

Re: Best way to make a column of week over week percent change?

I figured it out!! 

 

Lasts Week Total = 
var LastWeekComp =
    SUMX(
        FILTER(
            Sheet1, 
            Sheet1[Date] = EARLIER(Sheet1[Date]) - 7 
        )
        , Sheet1[Total])
return LastWeekComp
 
5 REPLIES 5
Community Support Team
Community Support Team

Re: Best way to make a column of week over week percent change?

Hi @weixiangzhang ,

I'm not so clear for your description, can you please share some sample data with expected result to help us clarify your requirement?

If you mean display the percent of current sales, you can try to use following measure formula:

Percent =
VAR currDate =
    MAX ( Table[Date] )
RETURN
    DIVIDE (
        SUM ( Table[Amount] ),
        CALCULATE (
            SUM ( Table[Amount] ),
            FILTER (
                ALLSELECTED ( Table ),
                [Date]
                    = DATE ( YEAR ( currDate ), MONTH ( currDate ), DAY ( currDate ) - 7 )
            ),
            VALUES ( Table[Category] )
        ),
        -1
    )

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
weixiangzhang Frequent Visitor
Frequent Visitor

Re: Best way to make a column of week over week percent change?

Thank you! I understand how to make a measure, the issue is that I can't convert that to a column. I want to be able to convert it to a column so I can use it as a filter. 

Community Support Team
Community Support Team

Re: Best way to make a column of week over week percent change?

Hi @weixiangzhang ,

Can you please share a pbix file with some sample data to test?

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
weixiangzhang Frequent Visitor
Frequent Visitor

Re: Best way to make a column of week over week percent change?

Yes, this is what I would like to do.

 

I would like to turn Last Week's Value as a column rather than a measure, so I can use a slicer on it. Is that possible?   Previous week.PNG

weixiangzhang Frequent Visitor
Frequent Visitor

Re: Best way to make a column of week over week percent change?

I figured it out!! 

 

Lasts Week Total = 
var LastWeekComp =
    SUMX(
        FILTER(
            Sheet1, 
            Sheet1[Date] = EARLIER(Sheet1[Date]) - 7 
        )
        , Sheet1[Total])
return LastWeekComp