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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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