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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Counting frequency for different cycle

Hi everyone, 

 

I would like to create a DAX column that can count the occurrences of a product category that must be put on shelf according to a specific cycle. For example, some category needs to be put on shelf only once per week (weekly). This mean that orders need to be placed consecutively to follow this rule. However, there may be some cases that we cannot follow this rule, so that's why I would like to create this column for checking. 

Let me give you more information about the example. Here we have the list of orders. For this case, we will concern only the frequency of category that the cycle is not daily (set the frequency to 1, if it is daily). We can see that food category are put on shelf for 2 times in week 32. Therefore, the later order will have the frequency of 2. For stationary category, which is monthly cycle, the orders are consecutive, so they will have the frequency of 1. Also, the food category is put on shelf again consecutively but on different weeks, so the frequency of the later one will be reset to 1.

Pheroxiz_0-1629079872417.png

 

What I was thinking is to use RANKX function, but I am not able to do it.


Your help is much appreciated.

 

1 REPLY 1
Anonymous
Not applicable

@Anonymous 
When you mean consecutive, do you mean the category is same as the category in the previous row?

 

This seems like a multiple if question, but dealing with consecutive using dax is complicate. Please share a table that I can copy paste, so we can test out.

 

 

Best

Paul

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.