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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

If condition on the next column

Hello everyone , i need help with a calculate if condition ,so my dax formula is :

IF((table1[column3]+1)=0, 0, table1[column2] but it does'nt work because it display the the value on all projetctions , i want that stop displaying the column 2 on the second projection of column3 = 0  , like when  " (column3 = 0)+1 only" stop there.
 
dax_LI.jpg
can you give some help please ?
3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , power bi do not concept for previous column next column for formula. So let us know what you need , based on that we need to create a formula

Like MOM

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


diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

 

check : https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello and thanks for your response, to be clear the column2 (a substraction by month)is a measure that I had already calculated it previously and i wanna just display the value when the column 3 (the rest of the substraction) turn to zero but the problem that I should keep the value of the column2 on the last month just to show that we have subtract this value (column2) so that is why the column 3 turns on zero so I thought that the formula that i did gonna to do the work but I'm wrong

Hi @Anonymous,

 

it is not at all clear what you are trying to do. Could you provide a sample report?(In order to share it upload it to e.g. dropbox/onedrive/other and share the link)

 

Cheers,
Sturla

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.