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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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