Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello tod@s, I have the following scenario and problem, with the following two measures:
Measure Last Purchase Date:
With these two measures I am looking to obtain the last purchase value of any item, for this I am also using two segmenters one to filter by month and another to filter some particular item.
My problem is the following, when filter by month and by item, the table shows you the last value and date of purchase, according to the filtered month, however, if I ask for all the months, the table only shows the last value and date of purchase of the year of that filtered item, what I want is that in the table it shows you the last values and date of purchase of each month.
PS: the month of July still has no purchase of the selected item, maybe in other items yes.
I appreciate the help.
@Syndicate_Admin , I hope you are well,
I'm sorry it doesn't work for me, given the following:
I attach my . Pbix
Hi @Syndicate_Admin ,
I created some data:
Here are the steps you can follow:
1. Create calculated table.
Calendar =
DISTINCT('Table'[Month])
2. Create measure.
Flag =
var _selectmonth=SELECTCOLUMNS('Calendar',"month",[Month])
var _selectitem=SELECTEDVALUE('Table'[item])
var _maxdate=MAXX(
FILTER(ALL('Table'),
'Table'[Month] in _selectmonth && 'Table'[item]=_selectitem&&'Table'[Month]=MAX('Table'[Month])),[Date])
return
IF(
MAX('Table'[Date]) =_maxdate,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @Syndicate_Admin
you need to modify the measures to consider both the item and the month context when calculating the last purchase date and amount.
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |