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.
Dear PBI Masters,
I got set of data showing sales for number of products ( a,b,c,d ets ) with historical month sales ( 18 months starting form 01/20 to 06/21)
I wanted to show sales only for those products that have zero sales in period 07-12/20. That was easy part:)
it goes like this:
Solved! Go to Solution.
Hi @MCG ,
Your measure seems to be wrong:
Please try this instead:
Measure =
var _maxDate=CALCULATE(max('Months'[Date]),ALL('Months'))
var _dateStart=DATE(YEAR(_maxDate)-1,MONTH(_maxDate)+1,1)
var _dateEnd=DATE(YEAR(_maxDate)-1,12,31)
var sales=CALCULATE(SUM(Months[Sales]),DATESBETWEEN('Months'[Date],_dateStart,_dateEnd))
return sales
If you want to dynamically show the X-axis base on the selected date period, you may apply a flag measure to filter pane ,like this:
Flag =
var _maxDate=CALCULATE(max('Months'[Date]),ALL('Months'))
var _dateStart=DATE(YEAR(_maxDate)-1,MONTH(_maxDate)+1,1)
var _dateEnd=DATE(YEAR(_maxDate)-1,12,31)
return IF(MAX('Months'[Date]) >=_dateStart && MAX('Months'[Date])<=_dateEnd,1,0)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MCG ,
Your measure seems to be wrong:
Please try this instead:
Measure =
var _maxDate=CALCULATE(max('Months'[Date]),ALL('Months'))
var _dateStart=DATE(YEAR(_maxDate)-1,MONTH(_maxDate)+1,1)
var _dateEnd=DATE(YEAR(_maxDate)-1,12,31)
var sales=CALCULATE(SUM(Months[Sales]),DATESBETWEEN('Months'[Date],_dateStart,_dateEnd))
return sales
If you want to dynamically show the X-axis base on the selected date period, you may apply a flag measure to filter pane ,like this:
Flag =
var _maxDate=CALCULATE(max('Months'[Date]),ALL('Months'))
var _dateStart=DATE(YEAR(_maxDate)-1,MONTH(_maxDate)+1,1)
var _dateEnd=DATE(YEAR(_maxDate)-1,12,31)
return IF(MAX('Months'[Date]) >=_dateStart && MAX('Months'[Date])<=_dateEnd,1,0)
Best Regards,
Eyelyn Qin
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 |
---|---|
103 | |
101 | |
87 | |
73 | |
67 |
User | Count |
---|---|
116 | |
109 | |
94 | |
79 | |
72 |