Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have added a column to a basic sales table in order to tag items with a first sale date within 4 months as "New", with the rest as "Old". I would like to rank only the items which are "New". I've tried numerous options involving the FILTER function, however none are working.
Here is my latest attempt:
New Items Rank = RANKX(ALL(Sales[ProductID]),CALCULATE(SUM(Sales[Units]),Sales[Status] = "New"),,DESC,Dense)
Solved! Go to Solution.
Hey,
maybe you have to adjust this part
... ,ALL(Table1[Category]) ...
of the above DAX statement to amore elaborated one, like so
,,, ,ALL(Table1[Category],Table1[column ...], ...) ...
If this will not work you may want to share a pbix with sample data, upload the pbix to onedrive or dropbox and share the link.
Regards,
Tom
Hey,
I have this sample data:
and created this measure:
Rank just new categories = IF(SELECTEDVALUE(Table1[Status],BLANK()) = "New" ,RANKX( CALCULATETABLE( FILTER( 'Table1' ,'Table1'[Status] = "New" ) ,ALL(Table1[Category]) ) ,CALCULATE(SUM(Table1[Amount])) , ,ASC ) ,BLANK() )
Now I'm able to create this table:
Hopefully this is what you are looking for.
Regards,
Tom
@TomMartens Thank you for your reply, however everything is now being ranked as "1".
Hey,
maybe you have to adjust this part
... ,ALL(Table1[Category]) ...
of the above DAX statement to amore elaborated one, like so
,,, ,ALL(Table1[Category],Table1[column ...], ...) ...
If this will not work you may want to share a pbix with sample data, upload the pbix to onedrive or dropbox and share the link.
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |