Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors