The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
123 | |
85 | |
77 | |
55 | |
49 |
User | Count |
---|---|
135 | |
127 | |
78 | |
64 | |
63 |