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,
I have a table where i used Eomonth() function to evaluate the past month up until one year from today's standpoint, equals to a specific number. For example the last month will me automatically evaluated as -1, two month before today's month is -2 and so fourth....
This value I have made accessible through a dropdown menu. Since I don't want to make a calculation for every month in a mesaure à la
if (selecetedvalues =-1 ......if selectedvalue=-2 then.....
I put it into a variable and only need to write the calculate function once:
VAR VALUE1 = SELECTEDVALUE('TableList'[Value1])
RETURN
CALCULATE(SUM('Table1'[ProductAmount]),
FILTER('Table1',
'Table1'[Quotation] = VALUE1)
)
The problem is it doesn't work. I get empty values. I double check with commenting out the caluclate function, if the variable is actually returning -1 when I set it to last month and it does. The card visual show the correct value. When I now write -1 directly into the calculate formula it works as well. So why it does not works intended?
VAR VALUE1 = SELECTEDVALUE('TableLIst'[Value1])
RETURN
CALCULATE(SUM('Table1'[ProductAmount]),
FILTER('Table1',
'Table1'[Month] = EDATE(DATE(YEAR(TODAY()),MONTH(TODAY()),1),VALUE1)
))
Here is also a Values1 as a Variable and I don't see any difference in evaluation.
I hope someone can understands whats happening here.
Best.
I have no way to restore your scene, can you provide relevant data and table information ? Or provide a simple pbix file, and then attach the results you want. Maybe this will help us deal with the problem better.
Best Regards
Community Support Team _ Ailsa Tao
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 | |
94 | |
82 | |
66 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |