Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

how to split month to multiple filter in power bi.

Hi,

Month 

Mar

Apr

May

June

july

 

i want to split in to below:

 

Current month        Previous month 

July                          June

 

Please help on this issue.

 

Regards,

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

I think you can add a calculated column to convert raw month fields and calculate the previous month to achieve your requirement.

Previous =
VAR curr =
    DATEVALUE ( [Month] & "/1" )
RETURN
    FORMAT ( DATE ( YEAR ( curr ), MONTH ( curr ) - 1, 1 ), "mmm" )

7.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Can I ask what is the context behing your request?  are you summarizing data in rows underneath it or just want previous month?

 

 

amitchandak
Super User
Super User

@Anonymous , try like

, Try like. You need two date table, both have month year in that. Keep slicer from each one .

 

measure1 =
var _min = minX(allselected(Date,Date[Date]))
var _max = manX(allselected(Date,Date[Date]))
return
calculate(sum(Table[Sales]), filter(Table,Table[Date]>=_min && Table[Date]<=_max))

 

Use the crossfilter is Date is joined and active.

measure2 =
var _min = minX(allselected(Date1,Date1[Date]))
var _max = manX(allselected(Date1,Date1[Date]))
return
calculate(sum(Table[Sales]), filter(Table,Table[Date]>=_min && Table[Date]<=_max))
//calculate(sum(Table[Sales]), filter(Table,Table[Date]>=_min && Table[Date]<=_max), crossfilter(Table[Date],Date[Date],none))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

I think you can add a calculated column to convert raw month fields and calculate the previous month to achieve your requirement.

Previous =
VAR curr =
    DATEVALUE ( [Month] & "/1" )
RETURN
    FORMAT ( DATE ( YEAR ( curr ), MONTH ( curr ) - 1, 1 ), "mmm" )

7.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
parry2k
Super User
Super User

@Anonymous not sure the purpose but you should be using time intelligence function using date table in your model, in this case, you can use previousmonth function to get the previous month. Add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.