Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hai Expert,
I need to build a report for finance which is they want to show total amount of sales. We have slicer year and month, for example i choose year 2023 and month May so the line graph below will automatically shows sales amount from January to May. Is any dax function to create above scenario.
Solved! Go to Solution.
SORRY FOR CONFUSION!
PLEASE TRY THIS
pls try this
measure2 =
VAR _Yearselect = MAX('dup calendar'[Year])
VAR _MonthSelect = MAX('dup calendar'[Month Number])
RETURN
CALCULATE(
[Sales] , KEEPFILTERS(FILTER(ALL('Calendar'),
'Calendar'[Year]= _Yearselect&&'Calendar'[Month Number]=_MonthSelect)))
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
If a slicer is filtering one month, there is no way to show additional months from the same table on either the rows or the columns
Therefore, we must create a separate table that is not subject to filtering from the slicer. This way, columns from that table show all the rows, and we can control their visibility through a measure.
I want to shows in Month, do I need to change DATEBETWEEN and date
you need to disable the link between the calendar and the spreadsheet next
this is how you can read
measure =
VAR _Dateselect = MAX('Calendar'[Date])
VAR _YearSelect = YEAR(_Dateselect)
RETURN
CALCULATE(
[Sales] , KEEPFILTERS(FILTER(ALL('table'),
'table'[Date]>= DATE(_YearSelect,1,1)&&'table'[Date]<=_Dateselect)))
Hai tq for response, I want to show in Month, I need to change YearSelect to MonthSelect right?
SORRY FOR CONFUSION!
PLEASE TRY THIS
Hai Expert,
I managed to do as follow your dashboard guidance, as shown below;
Another question, may I know is it possible from the same slicer, the yellow KPI just shown value for March only and the graph shown for last month as above
pls try this
measure2 =
VAR _Yearselect = MAX('dup calendar'[Year])
VAR _MonthSelect = MAX('dup calendar'[Month Number])
RETURN
CALCULATE(
[Sales] , KEEPFILTERS(FILTER(ALL('Calendar'),
'Calendar'[Year]= _Yearselect&&'Calendar'[Month Number]=_MonthSelect)))
Tq so much expert, u help me a lot 😊
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hai Expert, May I know why we need to duplicate the calendar table?
If a slicer is filtering one month, there is no way to show additional months from the same table on either the rows or the columns
Therefore, we must create a separate table that is not subject to filtering from the slicer. This way, columns from that table show all the rows, and we can control their visibility through a measure.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
85 | |
84 | |
67 | |
49 |
User | Count |
---|---|
131 | |
110 | |
97 | |
71 | |
67 |