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.
Below is the table I have :
I have 2 slicers from calendar table :
1. Column Year
2. Column Month Name
I am trying to get Last 6 Months Sales from TOP 5 Product of Current Selection.
So If selected slicer is June & 2018
the expected result in my component (Matrix : Rows=ProductName, Columns=MonthYear, Values=UnitSold)
(taking only TOP 5 on June and get the last 6 months historical unit sold)
but what I have got is as following :
(it is taking TOP 5 on each month instead of taking only TOP 5 on June and get the last 6 months historical unit sold)
based on this post, i create measure :
UnitSold =
VAR MinDate = MIN('Calendar'[Date])
VAR MaxDate = MAX('Calendar'[Date])
VAR TopRank =
CALCULATE([UnitSold_Last6Months],
KEEPFILTERS(
CALCULATETABLE(
TOPN(10, ALLSELECTED(Product[ProductName]), [UnitSold_Last6Months]),
CALCULATETABLE('Calendar', 'Calendar'[Date]>= MinDate, 'Calendar'[Date]<= MaxDate, ALL(Product))
)
)
)
RETURN TopRank
I really appreciate for any help and suggestion
Thank you
Hi @pbi_twahyu,
Could you please share your sample file to have a test if possible?
Regards,
Daniel He
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |