Forum Discussion
Remove older year
Hello,
I want to remove (circled in red) the first year (as integer value) from a serie.
I'm able to find that value, but unable to set right next step, removing it from the final anwser.
I've try different combinaisons of calculation and filter, but still in a dead end.
Three tables are involved.
- tblEntreprise
- tblEntrepriseDonnees
- CalendrierAnnuel
VAR ft=
CALCULATE( SUM(tblEntrepriseDonnees[sglCoutCapitauxPropres]),
FILTER( CalendrierAnnuel, AND(
CalendrierAnnuel[Année fiscale]>varPremiereAnne, USERELATIONSHIP(tblEntreprise[KEntreprise],tblEntrepriseDonnees[FKEntreprise]))))
Hello AmiraBedh ,
I've found a solution after multiple tries and fails.
Translate calculated column into measure
Thanks for your time.
6 Replies
- AmiraBedhSuper User
Try the following :
VAR varPremiereAnne = MIN(CalendrierAnnuel[Année fiscale])
RETURN
CALCULATE(
SUM(tblEntrepriseDonnees[sglCoutCapitauxPropres]),
FILTER(
CalendrierAnnuel,
CalendrierAnnuel[Année fiscale] > varPremiereAnne
),
USERELATIONSHIP(tblEntreprise[KEntreprise], tblEntrepriseDonnees[FKEntreprise])
)- Pier2Resolver I
Hello AmiraBedh ,
Thanks for your help.
I've try your solution. The result gives an empty chart, unfortunately. We must be close but I dont where's the problem. I would probably done it like you.
But I can have a sum in a card
The result is the same when I remove the USERELATIONSHIP part.
For the fun of it, I remove varPremiereAnne for 5 or 2015. Then I the chart is full.CALCULATE( SUM(tblEntrepriseDonnees[sglCoutCapitauxPropres]), FILTER( CalendrierAnnuel, CalendrierAnnuel[Année fiscale] > 5 ), USERELATIONSHIP(tblEntreprise[KEntreprise], tblEntrepriseDonnees[FKEntreprise]) )- AmiraBedhSuper User
Can you provide some data ? And your model ?
- Pier2Resolver I
Hello AmiraBedh ,
What i recently found is that when I substract a number (1 or something else) I see the graph. But everything vanish when remove that substraction or try any kind of addition.//See something in the graph VAR varPremiereAnnee = CALCULATE( MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise], tblEntrepriseDonnees[FKEntreprise]) )-1// See nothing in the graph VAR varPremiereAnnee = CALCULATE( MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise], tblEntrepriseDonnees[FKEntreprise]) )
Here's the data model.Data
tblEntrepriseKEntreprise txtEntrepriseNom 1 Karl's Inc 2 Joy's Books Store CalendrierAnnuel
Année fiscale 2013 2014 2015 2016 2017 2018 2019 tblEntrepriseDonnee
FKEntreprise intAnnee sglCoutCapitauxPropres ID 1 2015 1 1 2016 0,02 2 1 2017 0,03 3 1 2018 0,025 4 2 2014 5 2 2015 0,02 6 2 2016 0,00 7 2 2017 0,08 8 As you can see, in tblEntrepriseDonnee, on line 1 and 5, there's no number in the column sglCoutCapitauxPropres. That's why I don't want to see them in the graph. But, as on line # 7, I could find a zéro along the way and I want to see it.
Hope explanations are clear.