Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
weixiangzhang
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

I figured it out!! 

 

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

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

I figured it out!! 

 

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

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. 

Hi @weixiangzhang ,

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

Regards,

Xiaoxin Sheng

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.