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

How to get totals by week number

Hi, this maybe really simple to answer but as im new to this and have not found the answer online after a few hours and countless videos online please help.

 

I have a custom calender and would like to get the totals of each week number.  As this will be over a few years i would like to get the wekly totals from Years & Week.  I think i need to create a new column with week totals in?  It sfor week on week comparisons but i cant figure out the weekly totals to get that far yet.  Thanks for your help in advance.

 

Screenshot 2019-12-06 at 13.38.20.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to get totals by week number

HI @Ben_Veritas ,

I'd like to suggest you use year and week number as filter conditions to aggregate values.

Measure =
VAR currDate =
    MAX ( Table[Date] )
RETURN
    CALCULATE (
        SUM ( Table[Daily Total] ),
        FILTER (
            ALLSELECTED ( Table ),
            YEAR ( [Date] ) = YEAR ( currDate )
                && WEEKNUM ( [Date], 2 ) = WEEKNUM ( currDate, 2 )
        )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

3 REPLIES 3
PaulDBrown New Contributor
New Contributor

Re: How to get totals by week number

@Ben_Veritas 

Try this:

create measure for daily totals = SUM(dCalender[Daily Total])

 

and then create new measure along the lines of:

year and week totals = CALCULATE([daily totals], ALLEXCEPT(dCalender[Year & Week]))

Community Support Team
Community Support Team

Re: How to get totals by week number

HI @Ben_Veritas ,

I'd like to suggest you use year and week number as filter conditions to aggregate values.

Measure =
VAR currDate =
    MAX ( Table[Date] )
RETURN
    CALCULATE (
        SUM ( Table[Daily Total] ),
        FILTER (
            ALLSELECTED ( Table ),
            YEAR ( [Date] ) = YEAR ( currDate )
                && WEEKNUM ( [Date], 2 ) = WEEKNUM ( currDate, 2 )
        )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Ben_Veritas Frequent Visitor
Frequent Visitor

Re: How to get totals by week number

Thanks for your help that worked 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)