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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
kylee_anne
Helper II
Helper II

Parameters and DAX

Hi Everyone,

 

So is always the way it seems, I wrote some horrid clunky DAX as I was in a hurry.  This is an example.

 

CP_P6 Budgeted Units = CALCULATE(SUM('Resource B'[Value]),'Resource B'[Spreadsheet Field]="Budgeted Units",'Resource B'[Date]<=DATE(2025,10,30))+0
 
Rather than hard coding the dates for month end and the prior month end which are cumulatively used in about 20 DAX statements and 1 table construction query can I use parameters here?  I'm trying options but I can't seem to pick parameters up in DAX.
 
What am I missing or is there a better way?
 
Thanks.

 

1 ACCEPTED SOLUTION
kylee_anne
Helper II
Helper II

Nope I put in parameter as a field not in a slicer, created a table using it with M and then could use it in DAX.  

View solution in original post

5 REPLIES 5
Punithurs
Frequent Visitor

Hi, 
refer thia video. 
https://www.youtube.com/watch?v=90h9h8gN_LE 


Thanks,
Punith

kylee_anne
Helper II
Helper II

Nope I put in parameter as a field not in a slicer, created a table using it with M and then could use it in DAX.  

amitchandak
Super User
Super User

@kylee_anne , make sure you are having a date table, then you have MTD, this month last month etc using Time Intellignece 

CP_P6 Budgeted Units = CALCULATE(SUM('Resource B'[Value]),filter( 'Resource B', 'Resource B'[Spreadsheet Field]="Budgeted Units") )

Then have measure like 

MTD Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    DATESMTD('Date'[Date])
)

Last MTD Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    DATESMTD( DATEADD('Date'[Date], -1, MONTH) )
)

Last Month Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    PREVIOUSMONTH('Date'[Date])
)

Next Month Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    NEXTMONTH('Date'[Date])
)

This Month Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    DATESMTD( ENDOFMONTH('Date'[Date]) )
)

Last MTD (Complete) Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    DATESMTD( ENDOFMONTH( DATEADD('Date'[Date], -1, MONTH) ) )
)

Previous Month Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    PREVIOUSMONTH('Date'[Date])
)

Last Year Last Month Budgeted Units =
CALCULATE(
    [CP_P6 Budgeted Units],
    DATESMTD(
        DATEADD('Date'[Date], -1 * MONTH(TODAY()), MONTH)
    )
)

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
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 :radacad sqlbi My Video Series 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

Is it not possible to just use parameters?

@kylee_anne , Parameter means slicer here. If you are calling URL you can pass the parameters. You can reduce measures using Calculation groups 

Service URL, when you call a report-https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

You need to have slicers or filters. 

We have a dynamic M parameter for direct query- https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

We can have a calculation group to rescue measures- Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0 

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.