Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi everyone,
i had a measure to calculate the previous month data, it didn't showing on line chart but it's working on card.
what i really want is, when I choose Feb on month slicer, it's show the data for feb and jan
this is my data table
I think you forgot put your measure definition, there are many ways to do this. Here is one
Var selectedmonth = selectedvalue(Table[MonthNum))
Var prevMonth = selectedmonth - 1
Var last2months =treatas( {prevmonth, selectedmonth}, Table[MonthNum])
Var result = calculate([Measure], keepfilters(last2months))
return result
If the post helps please give a thumbs up
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Tharun
It works with me , after adding the variable in the beginning
LastMonthValue = Var selectedmonth = selectedvalue(Table1[Month])
Var prevMonth = selectedmonth - 1
Var last2months =treatas( {prevmonth, selectedmonth}, Table1[Month])
Var result = calculate([Last Month], keepfilters(last2months))
return result
but still didn't show on the line graph
Error
how can i fix it ?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
125 | |
78 | |
76 | |
59 | |
51 |
User | Count |
---|---|
164 | |
86 | |
68 | |
68 | |
58 |