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
could someone please help with following?
I have a simple table with two columns - Years (1990 - 2020) and Number of beehives.
I would like to compare year 2020 with years 2000 and 1990.
How would you do that?
Thank you very much!
example
Year | Number of beehives |
1990 | 20 000 |
1991 | 25 000 |
1992 | 30 000 |
1993 | 28 000 |
Solved! Go to Solution.
@Anonymous and @mangaus1111
Thank you very much both for your time!
I have no idea why the filtering with date doesn't work, format is date, not text,
so I used a bit "dirty" way to select a date:
Sum1990 = CALCULATE(SUM(table[number]),DATESBETWEEN(A_Year[Rok], DATE(1990,1,1), DATE(1990,1,1)))
I'm sure there is a smarter and nicer way, like create a variant or other, but I have to finish my task quickly and don't have time to search for different solution..
What about applying filters for assigned comparison visual with selected years? Is equal for year xxx and xxx
@Anonymous and @mangaus1111
Thank you very much both for your time!
I have no idea why the filtering with date doesn't work, format is date, not text,
so I used a bit "dirty" way to select a date:
Sum1990 = CALCULATE(SUM(table[number]),DATESBETWEEN(A_Year[Rok], DATE(1990,1,1), DATE(1990,1,1)))
I'm sure there is a smarter and nicer way, like create a variant or other, but I have to finish my task quickly and don't have time to search for different solution..
@mangaus1111 Thank you, but unfortunately this doesn'ty work - comparing date and text:
DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
Hi @KatkaS ,
you can try the below 3 measures.
1) Sum 2020 =
CALCULATE(
SUM('Table'[Number of beehives]),
'Table'[Year] = "2020"
)
2) Sum 2000 =
CALCULATE(
SUM('Table'[Number of beehives]),
'Table'[Year] = "2020"
)
3) Delta = [Sum 2020] - [Sum 2000]
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |