March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Greetings,
I have a 'Period' column and a 'Revenue' column in my table. I have set up a calendar table as well.
I am displaying previous month revenue (Previous of the month selected in the month slicer) as a card using the below DAX:
This is working fine.
Now i have a requirement to show the data of the last month as the default when the report is opened. In Power Query, i created a column called 'Last Month' that will have a value 'Last Month' for the last month, else null.
Expression = if Date.IsInPreviousMonth([Period]) then "Last Month" else "")
I use this column as a filter now.
When i select June - 2022 from the slicer, the last month revenue displays the May - 2022's revenue correctly. But when i select the 'Last Month' slicer, the last month value is same as that of the June month value.
What am i missing? Please assist.
Yours Truly,
Manikantan S
Solved! Go to Solution.
@Manikantans2 , Create a column like this and try
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)
Hi Amit,
The solution you provided is working. I guess i had to "Mark as Date Table" for the calendar table in addition. Thanks for the solution.
@Manikantans2 , Create a column like this and try
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)
Thanks Amit. The issue remains the same still.
Slight change to what you mentioned.
Created a column as :
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |