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
aclifton
Frequent Visitor

Multiplier/Counter for consecutive months above 38% GM

Hi everyone,

 

I'm trying to create a counter that will increase by 1 for each month when the GM% for the month is over 38%, which would then multiply another number by 1.5 after 3 consecutive months at 38%. If the 38% threshold is not met after this happens, the counter would reset to 0 and the multiplier would go back to 1 until the 3 month threshold is met again. I attached snippets of my formula and my results.

Currently, it is showing the value for every month with GM% over 38% as 4. Instead of this, I want it to start at 1 for the first occurance, then go to 2, and so on, and then go back to 0 and restart the cycle for when the GM% is not > 38%.  Any help would be greatly appreciated, please let me know if there is anything that needs to be cleared up! Thank you!

aclifton_0-1668011119601.png

 

aclifton_2-1668011370383.png

 

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @aclifton ,

 

Please check the measures:

Measure = IF([Qualified Gross Margin %]>=0.38,[Qualified Gross Margin %],0)

Measure 2 =
var _1=RANKX(FILTER(ALL('Table'),[Measure]<>0),CALCULATE(MAX('Table'[Month Year Index])),,ASC,Dense)
return
IF([Measure]=0,0,_1)

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay,

Thanks for the response. I tried your measures above and it still isn't correct.

 

['QGM If'] is your Measure

['Month Qualifier Test'] is your Measure 2

 

It seems that the number does appear as 0 when it is below 38%, but the count does not reset when an instance of a 0 happens. The count also seems to start at the first instance and just go up by 1 for each month. I need it to reset every time there is a 0. For example, in the beginning of the image where it starts at 1 , 2, 3, 4, 5, 6, 0... I need the Month Qualifier Test to return 1 again where it is returning 12, and again where it returns 18. This is because I need to apply a multiplier to any value greater than 4. Any additional help you could provide would be a huge help. Thanks again.

 

aclifton_1-1669907500696.png

 

aclifton
Frequent Visitor

Sure thing, heres a small table for all of 2021-2022. I need a measure that will count the number of months that have a Qualified Gross Margin % > 38%, and will them keep track of that moving into the next month and also reset if it does not meet that threshold. So for example, the measure would return 1 for Jan-21, 2 for Feb-21, and 3 for Mar-21, but then 0 again for Apr-21 because its not over 38% (but it would go to 4 if it was). Any help would be greatly appreciated. Thank you.

Please note in this table the Month Year and Month Year Index Columns are coming from a table called 'Calendar' and the Acct Manager Bonus and Qualified Gross Margin % are two measures that were created. 

 

Month YearMonth Year IndexAcct Manager BonusQualified Gross Margin %
Jan-21109$050.91%
Feb-21110$041.49%
Mar-21111$038.11%
Apr-21112$033.28%
May-21113$036.17%
Jun-21114$028.55%
Jul-21115$036.35%
Aug-21116$030.55%
Sep-21117$3,50038.18%
Oct-21118$3,00037.68%
Nov-21119$031.28%
Dec-21120$031.41%
Jan-22121$037.32%
Feb-22122$2,50036.11%
Mar-22123$4,50042.04%
Apr-22124$4,50042.04%
May-22125$4,50041.78%
Jun-22126$4,00039.84%
Jul-22127$4,50040.99%
Aug-22128$4,50044.09%
Sep-22129$4,50044.55%
Oct-22130$4,50045.95%
Nov-22131$4,50047.17%
v-jayw-msft
Community Support
Community Support

Hi @aclifton ,

 

Please share some sample data in text format so that we could use it test the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

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.