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
oscabape
New Member

Mesure with IF statement and date column

Hi all,

 

Im trying to build a messure refering to date column :

messure = IF(VSS110[Report Date]= 11/02/2019,VSS110[Net Amount Mesure]/2,VSS110[Net Amount Mesure])
 
The messure is not liking the date column logic.
 
How can I get this messure working? your help will be much appreciated.
 
Regards
oscar
1 ACCEPTED SOLUTION

@oscabape . first one will only work if the date is in the context. I correct the second one, some issue with the parenthesis

 

calculate(divide(VSS110[Net Amount Mesure],2), filter(VSS110, VSS110[Report Date] = date(2019,02,11))) + calculate(VSS110[Net Amount Mesure], filter(VSS110, VSS110[Report Date] <> date(2019,02,11)))

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

View solution in original post

4 REPLIES 4
oscabape
New Member

@amitchandak Thanks a lot for this, the second formula works well and through back the right amount now. So thank you for this... I wasn't sure how to biuld the formula I did try calculate but I wasn't building it properly. Not sure why the first formula still not throughing the right amount, the data has not change.

 

Once again thanks a lot for your help! much appreciated!

O

amitchandak
Super User
Super User

@oscabape , Try like

measure = IF( max(VSS110[Report Date]) = date(2019,02,11),VSS110[Net Amount Mesure]/2,VSS110[Net Amount Mesure])

 

or try like

 

calculate(VSS110[Net Amount Mesure]/2, filter(VSS110,VSS110[Report Date]) = date(2019,02,11)) + calculate(VSS110[Net Amount Mesure], filter(VSS110,VSS110[Report Date]) <> date(2019,02,11))

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

@amitchandak  Thanks a lot  for your help, The first formula it is now been accpeted, but don't seem to be deviding the amounts on date 11/00/2019 by 2....  so I am getting the wrong amount. I have tried including the Divide function but doesn work eaither. Any thoughts how we can divide this amounts by two?

 

the second formula is not been accpeted as there is problem with the filter column.

 

Thanks!

@oscabape . first one will only work if the date is in the context. I correct the second one, some issue with the parenthesis

 

calculate(divide(VSS110[Net Amount Mesure],2), filter(VSS110, VSS110[Report Date] = date(2019,02,11))) + calculate(VSS110[Net Amount Mesure], filter(VSS110, VSS110[Report Date] <> date(2019,02,11)))

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

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.