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.
Hello,
I don't understand why 2 measures with the same function hidden different result.
Measure 1:
Measure A-3 = var yeartoday = YEAR(TODAY())
var yearstart = yeartoday - 4
var theDatesTable = DATESBETWEEN('Date'[Date]; DATE(yearstart;7;1); DATE(yeartoday;6;30))
return
CALCULATE(CALCULATE(SUM('OPPFinal'[E.Amount]);theDatesTable;'OPPFinal'[E.StageName]="Close gagnée")
Measure 2:
[Exercice choisi] = SelectedValue('Date'[Année])
Measure test A-3 = var yeartoday = [Exercice choisi]
var yearstart = yeartoday - 4
var theDatesTable = DATESBETWEEN('Date'[Date]; DATE(yearstart;7;1); DATE(yeartoday;6;30))
return
CALCULATE(CALCULATE(SUM('OPPFinal'[E.Amount]);theDatesTable;'OPPFinal'[E.StageName]="Close gagnée")
Solved! Go to Solution.
Hey!
I don't have access to your data, so I'm have to make some presumptions about your data model.
I hope the following screenshot shows the difference between how SELECTEDVALUE and YEAR(TODAY()) calculates the date. It appears to be looking at the day rather than the year value.
The columns that have names beginning with Msr are measures. Here are the measures I used for each of those columns:
MsrYearToday = YEAR(TODAY()) MsrYearToday - 4 = [MsrYearToday] - 4 MsrSelectedValue - 4 = SELECTEDVALUE(Sheet1[ClmYearofDate]) - 4
Click HERE to access my .pbix file
I can't use Max(Date[Anne]) because my objectid it's when i choose a year i want the result change to
Hi @AlexGallet01,
Have you resolved your issue? If you have, please mark the right/helpful reply as answer. More people will benefit from here. If you haven't, please feel free to ask.
Thanks,
Angelia
Hey!
I don't have access to your data, so I'm have to make some presumptions about your data model.
I hope the following screenshot shows the difference between how SELECTEDVALUE and YEAR(TODAY()) calculates the date. It appears to be looking at the day rather than the year value.
The columns that have names beginning with Msr are measures. Here are the measures I used for each of those columns:
MsrYearToday = YEAR(TODAY()) MsrYearToday - 4 = [MsrYearToday] - 4 MsrSelectedValue - 4 = SELECTEDVALUE(Sheet1[ClmYearofDate]) - 4
Click HERE to access my .pbix file
Hey!
Can you provide a link to your .pbix file?
The only difference I can see is how the yeartoday variable is defined. That said, I suppose there is a difference between how YEAR(TODAY()) and SELECTEDVALUE is calculating dates.
I can't do a link to my .pbix sorry. And yes but the result of Year(today()) AND [Exercice choisi] is 2017 (integer) so i don't undestand why i dont'have the same result.
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 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |