Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Community,
I have a table called "MyTable" with 3 columns (Category, SubCategory, Date)
I added a column using this DAX code to rank subcategories within each group by date:
MyRanking=
RANKX(FILTER(ALL(MyTable),
MyTable[Category] = EARLIER(MyTable[Category])
),
MyTable[Date],,,Dense)
Here are the faces issues :
1. for some categories I get the same ranking when subcategories have the same date
2. for some categories some ranking numbers are missing.
Any suggestions?
Thank you in advance
@DataVitalizer , for column try like
MyRanking=
RANKX(FILTER((MyTable),
MyTable[Category] = EARLIER(MyTable[Category])
MyTable[SubCategory] = EARLIER(MyTable[SubCategory])
),
MyTable[Date],,asc,Dense)
For measure you can use new rank or rownumber
rank(DENSE,ALLSELECTED(MyTable[Category],MyTable[SubCategory],MyTable[Date]),ORDERBY([Date],asc))
add partitionBy if needed
This time I had only one value for all subCategories "1"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |