Forum Discussion
Filter by measure
- Anonymous5 years ago
I find the solution
Pris + Reste P A = CALCULATE(SUM(COMPTEUR_RS[Repos Compensateur Pris [jours]]])+SUM(COMPTEUR_RS[Repos Compensateur Reste à prendre [jours]]]);FILTER(COMPTEUR_RS;YEAR(COMPTEUR_RS[Période])=SELECTEDVALUE('DATE'[Année])))Total positifs = SUMX(VALUES(COMPTEUR_RS[Agent ID]);IF(CALCULATE(SUMX(COMPTEUR_RS;[Pris + Reste P A])-SUMX(COMPTEUR_RS;[Pris + Reste P A-1]))<0;0;CALCULATE(SUMX(COMPTEUR_RS;[Pris + Reste P A])-SUMX(COMPTEUR_RS;[Pris + Reste P A-1]))))
Thank you for your answer Anonymous . I am doing a simple addition followed by a subtraction.
Some results are negative so I filter them with my > 0.
In my table row by row it is displayed correctly. However in a visual where I want to calculate the total sum of positive values, I get 0. See the screen.
- Anonymous5 years agoNot applicable
Hi Anonymous ,
You could use sumx(0 function.
Refer:
Measure = IF([A]-[A-1]>0,[A]-[A-1],0) Measure 2 = SUMX('Table',[Measure])Best Regards,
Jay
- Anonymous5 years agoNot applicable
Thanks for the measurement but it gives me the same result as the year A measurement.
A measurement. And do not filter me any more the negative values that I do not count any more.
- Anonymous5 years agoNot applicable
Hi Anonymous ,
If you want to put the measure2 in the table visual that shows 163 for each row, you could modify the measure2 as below.
Measure 2 = SUMX(ALL('Table'),[Measure])Measure1 is work for measure2, you can remove it from the visual and use A-(A-1) instead.
Best Regards,
Jay