Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
I have a product table with ID, DATE, PRODUCT ,Count of products and index across the table.
ID | date | Product name | count | Index |
A001 | 1/1/2023 | Apple | 1 | 1 |
B002 | 1/2/2023 | Samsung | 4 | 2 |
C003 | 1/3/2023 | Apple | 5 | 3 |
D004 | 1/4/2023 | Microsoft | 2 | 4 |
E005 | 1/5/2023 | 3 | 5 | |
F006 | 1/6/2023 | Apple | 6 | 6 |
How to create a dynamic index which auto assigns the series when a filter is applied. For example, product name = 'Apple'
Output :
ID | date | Product name | count | Index |
A001 | 1/1/2023 | Apple | 1 | 1 |
C003 | 1/3/2023 | Apple | 5 | 2 |
F006 | 1/6/2023 | Apple | 6 | 3 |
Appreciate for your help!
Thanks
Solved! Go to Solution.
Hi,
I assume you want to create a meausure, not a calculated column.
Please check the below picture and the attached pbix file.
I authored a measure that results the index number, and it is depending on the date and the ID column.
Please kindly correct me if the logic to create the index number is different.
Index measure: =
COUNTROWS (
WINDOW (
1,
ABS,
0,
REL,
SUMMARIZE (
ALLSELECTED ( Data ),
Data[ID],
Data[date],
Data[Product name],
Data[count]
),
ORDERBY ( Data[date], ASC, Data[ID], ASC )
)
)
Hi @KN8 ,
Here are the steps you can follow:
1. Create measure.
Measure =
RANKX(
ALLSELECTED('Table'),CALCULATE(MAX('Table'[date])),,ASC)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
I assume you want to create a meausure, not a calculated column.
Please check the below picture and the attached pbix file.
I authored a measure that results the index number, and it is depending on the date and the ID column.
Please kindly correct me if the logic to create the index number is different.
Index measure: =
COUNTROWS (
WINDOW (
1,
ABS,
0,
REL,
SUMMARIZE (
ALLSELECTED ( Data ),
Data[ID],
Data[date],
Data[Product name],
Data[count]
),
ORDERBY ( Data[date], ASC, Data[ID], ASC )
)
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
53 | |
53 | |
36 | |
34 |
User | Count |
---|---|
84 | |
71 | |
55 | |
45 | |
43 |