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
Anonymous
Not applicable

Filter on unique values

OrderCreated weekReported weekPriorityStatus
100088811urgentInitiative
100088812

urgent

In progress
100088813urgentEvaluate
100098922lowIn progress
100088814urgentFinished
100089132highIn progress
100089133highEvaluate
100099013lowInitiative

 

Hi all,

 

I have the above dataset where on a weekly base we do a snapshot of our database containing orders with corresponding statuses. Every week a new shapshot is labeled using the reported week column, in this way you can see on a weekly basis if the status of an order has changed. The created week column provides the week in which the order is created and helps to find out if in a given week new orders have been entered.

 

I would like to have a visual where I can show how many new orders have been entered in a week with the status high en urgent, does anybody have an idea how I could do that? A new order can change status within a week, so filtering on initiative is not an option. E.g.: maybe the first week a ordernumber is shown you would like to have an extra column generating a 1 and if the ordernumber already popped up a week earlier that column should be left empty.

 

Cheers,

Lucas

 

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

Hi @Anonymous ,

 

Would you please refer to the following measure:

 

Measure = CALCULATE(DISTINCTCOUNT('Table'[Order]), FILTER('Table','Table'[Created week] = MAX('Table'[Created week])&&  CALCULATE(MAX('Table'[Priority]),FILTER(ALLEXCEPT('Table','Table'[Order]),'Table'[Reported week] = MIN('Table'[Reported week]))) in {"high", "urgent"}))

 

Capture.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Would you please refer to the following measure:

 

Measure = CALCULATE(DISTINCTCOUNT('Table'[Order]), FILTER('Table','Table'[Created week] = MAX('Table'[Created week])&&  CALCULATE(MAX('Table'[Priority]),FILTER(ALLEXCEPT('Table','Table'[Order]),'Table'[Reported week] = MIN('Table'[Reported week]))) in {"high", "urgent"}))

 

Capture.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , You need to have date/week table with following columns

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

or
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

 

 

measure like

This Week = CALCULATE(Count('Table'[Order]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank]) && 'Table'[Priority] in {"urgent", "high"} ))
Created before Week = CALCULATE('Table'('Table'[Order]), FILTER(ALL('Date'),'Date'[Week Rank]<=max('Date'[Week Rank])))

 

Created in this week with not before

if(not(isblank([This Week])) && isblank( [Created before Week ]),1,0)

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458

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.