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
Hi ,
I need to display Last 12 months data for a measure deoending on Year and Month selection.
I managed to write the measure, but when put in the Line chart, it gets filtered only for the selected month.
Any help is appreciated
Regards,
Priyanga
Solved! Go to Solution.
Hi @Anonymous ,
Did you have a dim_ date table? I suggest you create a date table and then you can use the following measure:
Last 12 months Sales =
VAR Start_date =
CALCULATE ( MAX ( Dim_Date[Date] ), ALLSELECTED ( Dim_Date ) )
RETURN
CALCULATE (
[Measure],
ALL ( Dim_Date ),
DATESINPERIOD ( Dim_Date[Date], [Start_date], -12, MONTH )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Did you have a dim_ date table? I suggest you create a date table and then you can use the following measure:
Last 12 months Sales =
VAR Start_date =
CALCULATE ( MAX ( Dim_Date[Date] ), ALLSELECTED ( Dim_Date ) )
RETURN
CALCULATE (
[Measure],
ALL ( Dim_Date ),
DATESINPERIOD ( Dim_Date[Date], [Start_date], -12, MONTH )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
hi, @Anonymous
If it is OK with you, please share your sample pbix file, or your measure. Then I can try to come up with a more accurate solution.
thank you.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
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.
Hi Jihwan,
I cannot attach sample pbix file due to security retrictions. But I have put down the measures
Calculated Column:
Regards,
Priyanga
Hi @Anonymous ,
Not clear much....can you please share your DAX code for the measure and if possible a sample file with sensitive data removed ?
Regards,
Jaideep
Hi Jaideep,
I cannot attach sample pbix file due to security retrictions. But I have put down the measures
Calculated Column:
Regards,
Priyanga
Proud to be a Super User!
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 |
---|---|
87 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
130 | |
110 | |
93 | |
70 | |
67 |