Forum Discussion
Create a dynamic index column based on Date Selection by user
- 4 years ago
Hi mohanpal
In Power BI, the calculated column cannot be dynamic according to users' selection in the slicer/filter. Only measures can be dynamic. You can use the following measure.
Rank = RANKX(ALLSELECTED('Date'[Date]),CALCULATE(MAX('Date'[Date])),,ASC,Dense)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hello!
I have a similar problem.
I am working witha data series that relates a "result" (pH, mass, etc) to "sample code" and, in order to calculate my intersect, slope and R² I need an index starting with 1
But when I filter my data, I need that the first sample be reenumerated to 1. Ex:
- First analysis: Sample 1 to 20 (1 = 1, 2 = 2, 3 = 3, ..., 20 samples)
- Second analysis: Sample 8 to 16 (8 = 1, 9 = 2, 10 = 3, ..., 16 = 9)
I tried your solutions but it didn't work. Maybe because my sample code is a text.
The same way I want select samples of annother product, ex: B1AA/22 - B12AA/22, and, when I change the products the index restart with 1
I expalin with more details of the statistics on DAX on LINEAR REGRESSION - X-AXIS IN TEXT FORMAT - Microsoft Power BI Community
Any ideas? v-jingzhang
Thank you very much