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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cristianml
Post Prodigy
Post Prodigy

Variables in measure to consider month numbers

Hi,

I need help to ADD a criteria in a measure.  

My measure works fine :

Rev/NWD Current Quarter = [Rev Current Quarter] / [NWD Value]

 

BUT I need to add an exception based on calendar. 

 

The criteria is that IF I am in the current quarter (FY22 Q2) AND in the second month (January'22) then I need ONLY to consider the sum of NWD Value that in this case for Dec21 and Jan22 is  30.4 = (16.91 + 19.33)

 

I need to do this becase I have to divide Revenue/NWD based on the same quantity of months and as you see Feb22 doesn't have value. 

cristianml_2-1646357975832.png

As you see above I have revenue of 529 and 573 in Dec and Jan and I need to divide this by considering only those 2 months for NWD values

cristianml_5-1646360146659.png

 

As you see I need to get 30.4 that is the result of : (cristianml_7-1646360218312.png) but at the moment is given me 20.1 cristianml_4-1646359581738.pngbacause is considering Fe22 

 

My idea was to create some Variables in order to get the current quarter... I can get to this by using

CALCULATE(MAX('00_CALENDAR'[FY & Q]   but also I need to get the 1st and 2nd month of the current quarter and I don´t know how to write this the variables.
 
Then if this happens I need to do an average on  NWD Value based on those 2 months. or 1 month. instead of the 3 months of the quarter that is giving me the measure at the moment. 

 

cristianml_1-1646357925434.png

 

Or Perhaps if I am under those months in the current month then substract NWD of the same month   like  [NWD Value] - [NWD Value] and the actual measure, let's say, gives the correct  SUM.

 

like :

cristianml_8-1646360324146.png

 

 

hope you can help me with any other idea.

 

Thanks

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Use a SWITCH() or IF() statement that handles the [Month & FY]  value of "Jan FY22"  different than all the other values.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Use a SWITCH() or IF() statement that handles the [Month & FY]  value of "Jan FY22"  different than all the other values.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors