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
I am having a date field in which I have all the dates. I want to get only current month and previous month name as filter. How to do this ?
I have tried max but it returns only current month number. Will TopN will work here, If yes can anyone tell me how?
Thanks for your time.
Solved! Go to Solution.
Hi @AnandRanga,
To remove the records in which MonthsNEW is blank, you can create a calculate table:
Table = CALCULATETABLE ( TIMESHEETANALYSISCUBE, TIMESHEETANALYSISCUBE[MonthsNEW] <> BLANK () )
Thanks,
Yuliana Gu
Hi @AnandRanga,
You want to filter data, right? Please try the below formula to create a calculate table:
NewTable = CALCULATETABLE ( TopTwoMonth, FILTER ( TopTwoMonth, TopTwoMonth[Date].[MonthNo] = MONTH ( TODAY () ) || TopTwoMonth[Date].[Year] = IF ( MONTH ( TODAY () ) = 1, YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) && TopTwoMonth[Date].[MonthNo] = IF ( MONTH ( TODAY () ) = 1, 12, MONTH ( TODAY () ) - 1 ) ) ) )
If you have any question, please feel free to ask.
Thanks,
Yuliana Gu
I will try your solution and will let you know baut for now I tried this and it is showing current and previous month but It is showing (blank) also. Transdate is the column contains all the dates.
MonthsNEW = IF(MONTH(TIMESHEETANALYSISCUBE[TRANSDATE])=Month(NOW()), "Current Month",IF(MONTH(TIMESHEETANALYSISCUBE[TRANSDATE])=Month(NOW())-1,"Previous month"))
Actually it is showing current and previous month but except these two months all the months are coming into (blank).
Is there any way to remove it ?
Thanks for your time.
Hi @AnandRanga,
To remove the records in which MonthsNEW is blank, you can create a calculate table:
Table = CALCULATETABLE ( TIMESHEETANALYSISCUBE, TIMESHEETANALYSISCUBE[MonthsNEW] <> BLANK () )
Thanks,
Yuliana Gu
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
84 | |
66 | |
54 | |
43 |
User | Count |
---|---|
203 | |
106 | |
98 | |
65 | |
56 |