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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BICrazy
Helper II
Helper II

Setting Date Parameters

Hi there Community,

I need help with a DAX Measure, please.  The below measure is working fine, however, I now need to make an amendment to the commission from 100 to 110 from the 1st Feb 2021.  Basically, before the 01 Feb 2021, the commission is 100 and on or after 01 Feb 2021, the commission increases to 110.

It would be great if I can insert this as a variable so that I can amend the parameters if needed.

I do have a calendar table that has an inactive relationship to the Mondo Connect Exchange table.

Actual Revenue @R100 Customer Level = 
VAR HISTORICCUSTOMERS = 
CALCULATE(
[Sold to RCS],'Calendar'[IsCurrentMonth] = "NO")

VAR CURRENTMONTHSCUSTOMERS = 
CALCULATE(
    [Sold to RCS],'Calendar'[IsCurrentMonth] = "YES")

VAR TOTALWORKDAYS = 
CALCULATE([Total Days],'Calendar'[IsCurrentMonth] = "YES")

VAR Fraud = 
CALCULATE([Sold to RCS], 'MondoConnectExchange'[Vendor Outcome] = "FRAUD") + 0

VAR COMMISSION = 100

RETURN
((CURRENTMONTHSCUSTOMERS  + HISTORICCUSTOMERS) * COMMISSION)

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BICrazy , replace VAR COMMISSION with this

 

VAR COMMISSION = if(max('Calendar'[Date]) <date(2021,02,10) ,100,110)

 

or

 

VAR COMMISSION = calculate(100,filter('Calendar','Calendar'[Date] <date(2021,02,10))) + calculate(110,filter('Calendar','Calendar'[Date] >= date(2021,02,10)))

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

2 REPLIES 2
BICrazy
Helper II
Helper II

@amitchandak 

This measure worked perfectly VAR COMMISSION = if(max('Calendar'[Date]) <date(2021,02,10) ,100,110).  I just changed the date from (2021,02,10) to (2021,02,01).  Thank you

amitchandak
Super User
Super User

@BICrazy , replace VAR COMMISSION with this

 

VAR COMMISSION = if(max('Calendar'[Date]) <date(2021,02,10) ,100,110)

 

or

 

VAR COMMISSION = calculate(100,filter('Calendar','Calendar'[Date] <date(2021,02,10))) + calculate(110,filter('Calendar','Calendar'[Date] >= date(2021,02,10)))

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (10,440)