Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Get the same results for every month of different years
what I get now is this using this measure :
What I wanna get is this the yellow values be repeated for every month the same result
this is possible ?
Solved! Go to Solution.
Hi @tatouis
This year Paye voyageur =
CALCULATE (
SUM ( 'Fichier le retour'[payé voyageur] ),
DATESBETWEEN (
'Calendar'[Date],
DATE ( YEAR ( TODAY () ), 01, 01 ),
DATE ( YEAR ( TODAY () ), 12, 31 )
)
)
The formula above is just another way of saying give me the the SUM ( 'Fichier le retour'[payé voyageur] ) for 2022 and let that sum be applied to the whole calendar table thus you're getting the 2022 total for every period in your visual. If you want to ge the sum for each month in 2022 and let that be applied to all months in the calendar table, you need to write your measure differently. Here's a sample formula as well as a screenshot of the result:
Current Year Value =
CALCULATE (
[Sum of Values],
FILTER ( ALL ( Dates[Year] ), Dates[Year] = YEAR ( TODAY () ) )
)
Please take note that I used a separate column for Year and Month and not the one from a date hierarchy.
Proud to be a Super User!
Hi @tatouis
This year Paye voyageur =
CALCULATE (
SUM ( 'Fichier le retour'[payé voyageur] ),
DATESBETWEEN (
'Calendar'[Date],
DATE ( YEAR ( TODAY () ), 01, 01 ),
DATE ( YEAR ( TODAY () ), 12, 31 )
)
)
The formula above is just another way of saying give me the the SUM ( 'Fichier le retour'[payé voyageur] ) for 2022 and let that sum be applied to the whole calendar table thus you're getting the 2022 total for every period in your visual. If you want to ge the sum for each month in 2022 and let that be applied to all months in the calendar table, you need to write your measure differently. Here's a sample formula as well as a screenshot of the result:
Current Year Value =
CALCULATE (
[Sum of Values],
FILTER ( ALL ( Dates[Year] ), Dates[Year] = YEAR ( TODAY () ) )
)
Please take note that I used a separate column for Year and Month and not the one from a date hierarchy.
Proud to be a Super User!
When I used this measure works but he didn't solve the real reason why I wanna make this measure,
New dax code used:
This is what I get now :
what I want is to have the line of 2022 always drawn and when I filter by year the other lines are changed in this way I can always compare this year (2022) with the year that I want to choose
I don't know if I managed to explain myself well or not, but thank you very much for your time and your answer.
Hi @tatouis ,
My first instinct would be to check the relationships in your model. I've recreated your issue and the measure works fine for me.
Did I help you today? Please accept my solution and hit the Kudos button.
i solve it thank you
User | Count |
---|---|
98 | |
90 | |
83 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |