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.
am working on a project to present my information and I need to have on two cards one with the last value of the current year 2020 that is being reported that they would come being 2274 and last year 1754 I am working with a calendar table and I have annexed the year 2019 and 2020 in the same table s i someone can help me with some simple measure would appreciate it.
Solved! Go to Solution.
Hi, @Alexgamb20
There are two tables in your model, a calendar table and a fact table, right? I recreated the sample data, one calendar table and one sales table. Then once again completed the vision of the two cards, only need to change the fields of the formula I mentioned above. If your requirement is still that you need two cards, then my formula will work.
For the measure you mentioned, I'm not sure why it is, such as YTD, I would use something like this:
DATESYTD =CALCULATE ( SUM ( 'Global-Superstore'[Sales] ), DATESYTD ( 'Global-Superstore'[Order Date] ))
I can’t know what your data looks like. You can check my sample data. Below is my attachment. If my formula still does not work, then you can share your sample data without any sesentive information so that we may be able to easily get a solution.
sample data:
my measure:
_CY = CALCULATE(SUM([Sale]),FILTER(ALL('Score'),EOMONTH('Score'[Date],0)=EOMONTH(MAX('Score'[Date]),0)))
_PY = CALCULATE(SUM([Sale]),FILTER(ALL('Score'),EOMONTH('Score'[Date],0)=EOMONTH(MAX('Score'[Date]),-12)))
my result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Alexgamb20
This is a really useful tip.
1. To create a folder and group the measures
Enter the model tab and hold "Ctrl" to select the measure you want. then type the folder name in "Display folder" under properties.
2. JANUARY->>JAN
You need to know the format function.
demo: https://dax.guide/format/
my formula:
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Alexgamb20
This is a really useful tip.
1. To create a folder and group the measures
Enter the model tab and hold "Ctrl" to select the measure you want. then type the folder name in "Display folder" under properties.
2. JANUARY->>JAN
You need to know the format function.
demo: https://dax.guide/format/
my formula:
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you are a capo my friend, you should be at NASA. Thanks a lot
Hi, @Syndicate_Admin
try to create 2 measures like below:
current year = CALCULATE(SUM([Sales]),FILTER(ALL('Table'),EOMONTH([Date],0)=EOMONTH(MAX([Date]),0)))
Last year = CALCULATE(SUM([Sales]),FILTER(ALL('Table'),EOMONTH([Date],0)=EOMONTH(MAX([Date]),-12)))
Result:
Please refer to the attachment below for details
(The sales values in my sample use a random function, so if you open my sample file you may not see the same summation values as I do.)
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I did it this way but it didn't work for me. although what I need is exactly the same... maybe ea xq I'm using a calendar table.
Hi, @Syndicate_Admin
Not sure what your model looks like, could you please consdier sharing more details about it or a simple sample file without any sesentive information for further discussion? then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon Zheng
Estoy usando una tabla calendario para el control de las fechas, la cual esta relacionada.
En la grafica hay 2 años que seria el año presente 2020 vs el año pasado 2019, lo que hice fue anexar las dos tablas en una sola, osea en una sola tabla esta el 2020 con 2019 la cual use la formula samperlastyear para que me salga en una sola grafica.
YTD = año a la fecha
PY: Año pasado
FY: Todo el año
La formula del 2020 es esta:
Hi, @Alexgamb20
There are two tables in your model, a calendar table and a fact table, right? I recreated the sample data, one calendar table and one sales table. Then once again completed the vision of the two cards, only need to change the fields of the formula I mentioned above. If your requirement is still that you need two cards, then my formula will work.
For the measure you mentioned, I'm not sure why it is, such as YTD, I would use something like this:
DATESYTD =CALCULATE ( SUM ( 'Global-Superstore'[Sales] ), DATESYTD ( 'Global-Superstore'[Order Date] ))
I can’t know what your data looks like. You can check my sample data. Below is my attachment. If my formula still does not work, then you can share your sample data without any sesentive information so that we may be able to easily get a solution.
sample data:
my measure:
_CY = CALCULATE(SUM([Sale]),FILTER(ALL('Score'),EOMONTH('Score'[Date],0)=EOMONTH(MAX('Score'[Date]),0)))
_PY = CALCULATE(SUM([Sale]),FILTER(ALL('Score'),EOMONTH('Score'[Date],0)=EOMONTH(MAX('Score'[Date]),-12)))
my result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Perfect served me.. but a question before closing the case.. how did you create a folder and group the measures? and another as I can change the dates to English currently appears to me as JANUARY I want to have them as JAN
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |