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 requiremet to get the idexes for each group of data.
Please find sample data below:
Note: We have other columns too in the actual data. this is only a sample data
Protocol | Status | Date |
A | Approved | 1/2/2022 |
B | Open | 5/6/2022 |
B | In Progress | 5/7/2022 |
B | Closed | 5/8/2022 |
C | In Progress | 5/7/2022 |
C | Closed | 5/8/2022 |
D | Exempt | 5/9/2023 |
Expected Output:
Protocol | Status | Date | Index |
A | Approved | 1/2/2022 | 1 |
B | Open | 5/6/2022 | 1 |
B | In Progress | 5/7/2022 | 2 |
B | Closed | 5/8/2022 | 3 |
C | In Progress | 5/7/2022 | 1 |
C | Closed | 5/8/2022 | 2 |
D | Exempt | 5/9/2023 | 1 |
Could somone pls let me know how to achieve this using DAX.
Thank you
If the Index is based on date, then you're basically looking for the count of items less than or equal to the current date for each Protocol.
This is the DAX I used:
Index = COUNTROWS(FILTER(ALL('Table'), 'Table'[Date] <= SELECTEDVALUE('Table'[Date]) && 'Table'[Protocol] = SELECTEDVALUE('Table'[Protocol])))
@vicky_ I am trying to assign a row number for every statuses of a protocol. Can we have the DAX without using the date?
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.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
80 | |
48 | |
40 |
User | Count |
---|---|
150 | |
110 | |
64 | |
64 | |
58 |