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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Monthly Rolling in Power BI

Hi,

 

I am very new in Power BI.

I am trying to calculate rolling sales margin by month in Power BI.

I am using below formula:

SM% rolling = calculate(sum(T2[SM(k)])/sum(T2[Rev(k)]),

                       filter(T3,T3[Month]<=max(T3[Month])&&

                       T3[Month]>(max(T3[Month])-12)))

 

But when I am crossedchecked the above values in a table. it seems the value for 2nd quarter i.e for 2017 Q2, it is only considering months - 4,5,6 but not all months i.e. 1 to 6. I think I have to add one filter which will ignore Quarter selection. But at the same time I have to show values for 'Quarter' dimension.

I will aprreciate if anyone can help me on this.

Thanks!

 

 

Regards,

Poonam

 

SM RollingSM RollingIt give 75% SMIt give 75% SM

 

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi  @Anonymous,

 

Have you solved your problem with the replies?

 

If you have, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share some data sample and your desired output, so that we can help further investigate on it?

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=CALCULATE(sum(T2[SM(k)])/sum(T2[Rev(k)]),DATESYTD(Calendar[Date],"31/12/")

 

There should be a Calendar Table and a relationship from the Date column  of the T2 table to the Date column of the Calendar Table.  In the Calendar Table, write calculated column formulas for extracting Year, Quarter and Month.  In the visual, drag the Year/Month/Quarter from the Calendar Table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
CheenuSing
Community Champion
Community Champion

Hi @Anonymous

 

 

Can you share some data or the pbix in onedrive or google share drive and provide the link to find a solution.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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