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
siva54
Helper I
Helper I

Grouping based Selected value

Hi Team,

 

I'm new to power bi,  kindly help me out for below requirement.

I have month-year slicer.

If we selected any one of the month, i needed sum of previous month data and current month data in two bars.

 

we need to group before month in one bar and selected month in one bar.

 

siva54_0-1632471040095.png

 

the final output i need is if we select any month, the bar should be group into two bars one is selected month bar and previous month bar.  Please help me if it not works and do let me know the alternative.

 

Thanks & Regards,

Siva54

 

2 REPLIES 2
amitchandak
Super User
Super User

@siva54 , if you have date , then you can use time intelligence two get current and prior

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

 

 

But if you want more than one month as a legend, then you need an independent table

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

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

Hi amitchandak,

 

I need based on selected value of Month text.

 

For example, if we select may 21 then till may 21 in one bar and May 21 in another bar.

 

regards,

Siva54

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.