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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Change column if days condition.

Hey guys,

 

I have two columns

 

One is the daily amount and the other is the monthly total amount

 

Example

Daily Amount = 1000

Monthly total amount = 26000

 

I do a calculation that if the maximum date is less than the 28th day it makes the daily value multiplied by the number of days, but if it is the 28th or 29th or 30th or 31st it returns the value of the Monthly total amount

 

Example:

February 25 = 1000*25 = 25000

February 28 = 26000

 

Follow the calculation below

Meta Prod. Diária GCA Card = IF(MAX('Calendário'[Day])=31 || MAX('Calendário'[Day])=30 || MAX('Calendário'[Day])=29 || MAX('Calendário'[Day])=28 ,[Meta Produção GCA],[Meta Prod. Diária GCA Card_1])
 
 
However I need this to work in 2 months or more.
 
Example Date Slicer:
January,1 to February,25
January = Monthly total amount + February = Daily Amount * 25
 
how do i do it dynamically?
 
1 REPLY 1
lbendlin
Super User
Super User

One way would be to add a calculated column that uses your calculation, and then use that column together with the date slicer.  

 

If, however, you need to use a measure then this is a lot more complicated.

 

So - please clarify what you mean by "dynamically" 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.