Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello community,
I have the following situation:
In the "PROGETTO" Table there are different sort of projects, In the "PRODOTTI" Table there are different kind of products related to each project. For example the project "PRO_0001" can have three different kind of products (each product has a € value (Prodotto_Importo Column).
In the "PROGETTO" Table there are also a column called "Progetto_Stato" which contains the current status of the project ("On going", "Abandoned", "Finished").
I would like to create a rank formula which calcs the rank of each project in terms of values, but only considering those ones that have a status not equal to "Abandoned".
There are 10 projects, but in the picture you can see just only 6 because PRO_0004 and PRO_0008 are "Abandoned" (I insert "Progetto_Stato" in the "Visual Level Filters". And there aren't PRO_0009 and PRO_0010 because they are related to year 2018 and I want just 2019's once (I selected 2019 in the Year Filter).
How can i get the correct rank of these projects? I tried to use this formula but it doesn't work:
Importo_Rank =
With this formula the table shows me even the PRO_0009 and PRO_0010 (Year 2018) and for each project it gives a rank equal to 1.
Thanks in advance
Andrea
Hi @AndreaRSMRCT
Try this.
RANKX( CALCULATETABLE( VALUES(PROGETTO[Progetto_Cod]), ALLSELECTED() ), SUM(PRODOTTI[Prodotto_Importo]),, DESC )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Mariusz,
The result is still the same. I post a screenshot:
I don't know why when I use the rank function the selection made on Year filter doesn't work and it shows me even the projects of the 2018.
Andrea
Hi @AndreaRSMRCT,
Try the wrapping your SUM in CALCULATE as below or replace the SUM expression with [Prodotto Importo] Measure if you have created one.
RANKX( CALCULATETABLE( VALUES(PROGETTO[Progetto_Cod]), ALLSELECTED() ), CALCULATE(SUM(PRODOTTI[Prodotto_Importo])),, DESC )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Now it's working except for the 2018's values:
Because when I select 2019 from the related filter I would like to see just the projects created in 2019.
I thought that ALLSELECTED was able to do it.
Andrea
Try the below.
RANKX( CALCULATETABLE( VALUES(PRODOTTI[Progetto_Cod]), ALLSELECTED() ), CALCULATE(SUM(PRODOTTI[Prodotto_Importo])),, DESC )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
No it doesn't seems to work with the last solution.
It gives me rank equal to 1 for each row.
Andrea
User | Count |
---|---|
126 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |