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
pal95
Helper III
Helper III

Calculate number of tasks from the previous week (ignoring filters)

Hi,

In my report, I have Inspectors who are conducting inspections. I calculate the number of inspections made by the Inspectors just by using COUNTROWS and week filters and it is working great, but I would like to add the comparison of the number of inspections from this week and the previous week.

So basically, if I have week 29 now and one of my inspectors made 15 inspections this week, I would like to make a KPI comparison between his week 29 score and week 28, when he did 13 inspections.

Any ideas on how to do this? Screens attached.Table.PNG

filter.PNG
Regards,

2 ACCEPTED SOLUTIONS
v-jayw-msft
Community Support
Community Support

Hi @pal95 ,

 

You will need to create two tables, one for week of year and one for inspector name. Make sure there's no relationship between fact table and these two table then use these tables as slicers.

Create measures as below.

current_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])&&'Table'[name]=SELECTEDVALUE('name'[name])))

previous_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])-1&&'Table'[name]=SELECTEDVALUE('name'[name])))

Sample data for your reference.

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

I modify this a bit and it works

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @pal95 ,

 

You will need to create two tables, one for week of year and one for inspector name. Make sure there's no relationship between fact table and these two table then use these tables as slicers.

Create measures as below.

current_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])&&'Table'[name]=SELECTEDVALUE('name'[name])))

previous_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])-1&&'Table'[name]=SELECTEDVALUE('name'[name])))

Sample data for your reference.

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

It works, but only to this particular indicator. How to make other visuals on the same to 'listen' to the filters?

I modify this a bit and it works

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.