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
christianfcbmx
Post Patron
Post Patron

Comulative formula by week? is it possible?

Hi! I need to make a comulative formula by week, anybody got an idea how in my example?

I have two main problems:

 

1-. I want to use the column week of the Mineral Ext+ table not the calendar but I cant get a logic result.

2-. I need to hide months there are no data...my formula shows the other months.

Sample data: https://www.dropbox.com/s/guw4ffb5aoxrrp3/PBI%20EXAMPLE.pbix?dl=0

 

Consulta cumulative week.JPG

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @christianfcbmx .

Yes, it is possible. You can do cumulative by step condition filter on year and weeknum.

For example:

Cumulative =
VAR currDate =
    MAX ( calendar[Date] )
RETURN
    CALCULATE (
        SUM ( table[Amount] ),
        FILTER (
            ALLSELECTED ( table ),
            YEAR ( table[date] ) = YEAR ( currDate )
                && WEEKNUM ( table[date], 1 ) <= WEEKNUM ( currdate, 1 )
        )
    )

Notice: please do mask on sensitive date before share and not attach whole data model table.(you only need to share key fields which formula required)

Regards,

Xiaoxin Sheng

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

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @christianfcbmx .

Yes, it is possible. You can do cumulative by step condition filter on year and weeknum.

For example:

Cumulative =
VAR currDate =
    MAX ( calendar[Date] )
RETURN
    CALCULATE (
        SUM ( table[Amount] ),
        FILTER (
            ALLSELECTED ( table ),
            YEAR ( table[date] ) = YEAR ( currDate )
                && WEEKNUM ( table[date], 1 ) <= WEEKNUM ( currdate, 1 )
        )
    )

Notice: please do mask on sensitive date before share and not attach whole data model table.(you only need to share key fields which formula required)

Regards,

Xiaoxin Sheng

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

Helpful resources

Announcements
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.