Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi, I have a Year-Month slicer and a matrix showing the sales for each month.
If i select 2021-March, I would like the matrix to show sales for January, February and March. However, it only shows the sales for 2021-March.
How can i fix this? Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
Make sure there's no active relationship between calendar table and the fact table. If the date slicer you are using is from the fact table, you will need to create another date table as slicer(to make sure the matrix won't be flitered by the slicer). Then create a measure like:
measure =
var matrix_month = month(selectedvalue('fact'[date]))
var slicer_month = month(selectedvalue('calendar'[date]))
var slicer_last2_month = month(edate(selectedvalue('calendar'[date]),-2))
return
if(matrxi_month <= slicer_month && matrix_month >= slicer_last2_month, 1, 0)
At last, put the measure to martrix visual filter where measure = 1.
Best Regards,
Jay
Hi @Anonymous ,
Make sure there's no active relationship between calendar table and the fact table. If the date slicer you are using is from the fact table, you will need to create another date table as slicer(to make sure the matrix won't be flitered by the slicer). Then create a measure like:
measure =
var matrix_month = month(selectedvalue('fact'[date]))
var slicer_month = month(selectedvalue('calendar'[date]))
var slicer_last2_month = month(edate(selectedvalue('calendar'[date]),-2))
return
if(matrxi_month <= slicer_month && matrix_month >= slicer_last2_month, 1, 0)
At last, put the measure to martrix visual filter where measure = 1.
Best Regards,
Jay
@Anonymous , if you this month year from a date table, You can use YTD
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD("Date"[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd("Date"[Date],-1,Year),"12/31"))
If you want trend, means want to show month
then
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hi, thanks for your answer, but I'm afraid this is not the solution I'm looking for.
Let's say I have 3 salesmen, namely ABC; and 2 types of sales,namely Sales and Backorder.
When I select March 2021 from my slicer, I would like my matrix to look like the table on the right, but instead the table on the left is what I'm currently stuck with.
May I know how can I fix this? Thank you?
User | Count |
---|---|
128 | |
109 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |