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.
Hi Guys,
How could I calculate the value of last month's sales by category?
I created the below measure, but when I put it in the pie chart, it gives me the total value of the category, and I would like to get only the last month's value
_Total Vendas LM =
CALCULATE(
[_Total vendas],
DATEADD(d_calendario[Date],-1,MONTH))
Result I would like to get in the graph above:
Solved! Go to Solution.
pls try this
_Total Vendas LM =
VAR _toDay= TODAY()
VAR _StartDate = EOMONTH( _toDay,-1)
VAR _EndtDate = EOMONTH( _toDay,-2)+1
RETURN
CALCULATE(
[_Total vendas],
d_calendario[Date] >= _StartDate && d_calendario[Date] <=_EndtDate)
try this
_Total Vendas LM =
VAR _toDay= TODAY()
VAR _StartDate = EOMONTH( _toDay,-1)
VAR _EndtDate = EOMONTH( _toDay,-2)+1
RETURN
CALCULATE(
[_Total vendas], FILTER(ALL(d_calendario),
d_calendario[Date] >= _StartDate && d_calendario[Date] <=_EndtDate))
Share sample pbix file to help you
pls try this
_Total Vendas LM =
VAR _toDay= TODAY()
VAR _StartDate = EOMONTH( _toDay,-1)
VAR _EndtDate = EOMONTH( _toDay,-2)+1
RETURN
CALCULATE(
[_Total vendas],
d_calendario[Date] >= _StartDate && d_calendario[Date] <=_EndtDate)
@Ahmedx Thank you so much.
It worked, I was just changing the beginning of the month and the end of the month, that's why I was bringing empty.
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |