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
Zaky
Helper IV
Helper IV

Seeking Help for Running Total Measure

Hi Experts,

 

I seek for help as follows:

1) To count for Returned status for every week of each month.

2) Running total measure for accumulative return for the returned status above.

 

Expected result should be as table below:

table.JPG

 

Data table is in this link>> https://1drv.ms/u/s!AqKwe2kf8OBIZ45s1gEQQqqgE-Q?e=LVhwg0

 

Thanks

 

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

Hi @Zaky ,

 

You could get the result by following steps but you couldn't get the same visual if you are using two measures.

Create columns.

Week = 
var currentweek=WEEKNUM('Table'[Month of Return],1)
var startWeek=WEEKNUM(DATE('Table'[Month of Return].[Year],'Table'[Month of Return].[MonthNo],1),1)
return
"week"&Currentweek-startWeek+1

month = FORMAT('Table'[Month of Return],"MMM")

Create measures.

Measure = COUNTROWS('Table')

Measure 2 = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Month of Return]<=MAX('Table'[Month of Return])))

Result would be shown as below.

14.PNG

15.PNG

 

Best Regards,

Jay

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

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Zaky ,

 

You could get the result by following steps but you couldn't get the same visual if you are using two measures.

Create columns.

Week = 
var currentweek=WEEKNUM('Table'[Month of Return],1)
var startWeek=WEEKNUM(DATE('Table'[Month of Return].[Year],'Table'[Month of Return].[MonthNo],1),1)
return
"week"&Currentweek-startWeek+1

month = FORMAT('Table'[Month of Return],"MMM")

Create measures.

Measure = COUNTROWS('Table')

Measure 2 = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Month of Return]<=MAX('Table'[Month of Return])))

Result would be shown as below.

14.PNG

15.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Zaky , You can join the date with a date table and in date table get month week like

 

Start Month = STARTOMONTH('Date'[Date])
WeekDay = WEEKDAY([Date],2) //monday
Start of Week = [Date] -[WeekDay]+1 //monday
Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1

 

return =countrows(Table]) //weekly return

Cumm Sales = CALCULATE(countrows(Table]),filter(allselected(date),date[date] <=max(date[date])))

Dear @amitchandak 

Thanks for the solution. But i don't get understand your instruction.

I would be much appreciated if you can show me the way of doing this in .PBIX example.

The data table as i attached in the link.

 

Thanks

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.