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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
cristianj
Helper IV
Helper IV

count number of appearance in a table

Hello, 

i have this script 

ValidOrdersNumber = calculate(
count(orders[id])
,ALLEXCEPT(orders,orders[buyer_id]),orders[order_state_id]=3) , which count the total number of appearance in table, how can i transform it to tell me the position  of it, i mean it;s the first, the second, the third?...
[id] is primary key
Thank you
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cristianj , Not very clear. One option is have rank on order date

 

a new column

 

Rank = ranxk(filter(Table, [buyer_id] =earlier([buyer_id]) ) , [Order date],,asc,dense)

 

If you are to bucket the occurrence of measure, then you need dynamic segmentation

 

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@cristianj , Not very clear. One option is have rank on order date

 

a new column

 

Rank = ranxk(filter(Table, [buyer_id] =earlier([buyer_id]) ) , [Order date],,asc,dense)

 

If you are to bucket the occurrence of measure, then you need dynamic segmentation

 

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

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

Hello, 

can you help me with one more filter ,  i need also thet order_state_id=3

idbuyer_idorder_stateId 
1asx1 
2asx31
3azt1 
4azt2 
5azt31
6asx1 
7art1 
8azt2 
9art31
10asx3

2

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.