Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all,
Appreciate if anyone can help me with this.
Background: To create a measure "LY Sales" that can be sliced by a range of TransactionDate
Problem Faced: It works when I sliced the data by individual day. However, when I chose the period 14/6/2017 to 15/6/2017, I got an error message "A table of multiple values was supplied where a single value was expected."
Solved! Go to Solution.
Hi all,
I solved the problem with the following measure:
FOX LY Sales =
CALCULATE (SUM('FOX LY Data'[Net Sales]),
FILTER(
ALL(DateKey),
COUNTROWS(FILTER(DateKey, EARLIER(DateKey[Date]) = DATEADD(DateKey[Date], -1, YEAR)))))
Thanks all whom have replied!
Hi all,
I solved the problem with the following measure:
FOX LY Sales =
CALCULATE (SUM('FOX LY Data'[Net Sales]),
FILTER(
ALL(DateKey),
COUNTROWS(FILTER(DateKey, EARLIER(DateKey[Date]) = DATEADD(DateKey[Date], -1, YEAR)))))
Thanks all whom have replied!
Based on your DAX expression, it seems that you need to calculated the value for same period for last year. If that is the case, you could use SAMEPERIODLASTYEAR function which returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.
https://msdn.microsoft.com/en-us/library/ee634972.aspx
Regards,
Charlie Liao
Hey,
please provide the formula for your "LY Sales" measure.
Regards
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
94 | |
91 | |
82 | |
69 |
User | Count |
---|---|
161 | |
127 | |
124 | |
108 | |
97 |