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 all,
I'm trying to get the count of orders for a previous year. I have the answer via filters, but I'm trying to get it in a measure as part of a larger calculation. However, the below function does not seem to be filtering the data and is instead returning the results of all the years. Anyone know why?
Solved! Go to Solution.
You can try:
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))
If its a datatimecolumn use YEAR([datecolumn]) ofcourse.
Quality over Quantity
You can try:
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))
If its a datatimecolumn use YEAR([datecolumn]) ofcourse.
Quality over Quantity
I swapped the filtering of the fact table to filter the date dim table and that worked per your solution.
Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count],
FILTER(DimDate, DimDate[Year] = YEAR(TODAY())-1))
Thanks!
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 |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |