Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everyone,
Need help in below expression....I have a measure called MTD FORMULA like this.
MTD FORMULA=IF(VALUE(MONTH(MaxDate)))='12' AND CEILING(DAY(MAXDATE/7),1)< CALCULATE(MAX(MaxNumOfPayWeeksInMonth),FILTER(FACT1, FACT1[MONTH] = "12/2019")),
CALCULATE(SUM(MID_MONTH_NET_AMOUNT), FILTER(FACT1, FACT1[MONTH] = "12/2019" && FACT1[WeekNum] = "<=2")),
CALCULATE(SUM(MTD_NET_AMOUNT), FILTER(FACT1, FACT1[MONTH] = "12/2019"))).
Now, i want to use this for other multiple measures as MTD FORMULA(12),MTD FORMULA(11)....I want the MTD FORMULA expression to be static and i should be able to pass arguments such as 12,11 etc...for this i need to have a variable in MTD FORMULA that will accept the arguments passed and replace the varuiable with value.
Please help me get out of this.
Thankyou
Hi @Anonymous ,
I think that you want to create a custom DAX function which has parameters. I am afraid that Power BI doesn't support it currently.
However you could use VAR to define some static formula like VAR a = SUM(MID_MONTH_NET_AMOUNT).
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 74 | |
| 51 | |
| 50 | |
| 46 |