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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
BuistJF
Frequent Visitor

Filter that can adjust the variable in dax measure

I have a dax measure, see below. I would ideally like to have a slicer / filter where a user can select a 1 or 2 or 3 in the filter and it adjusts the number of months that are include in the below dax (red number). Is this possible?

 

1 Month Act =
CALCULATE (
    AVERAGEX ( DSET_3_Month, DSET_3_Month[Activate Count] ),
    DATESINPERIOD (
        DSET_3_Month[Date],
        LASTDATE ( DSET_3_Month[Date] ),
        -1,
        MONTH
    )
)
1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

HI @BuistJF 

 

You can use a numerica parameter:

Mikelytics_0-1669906756932.png

 

Mikelytics_1-1669906856412.png

Mikelytics_2-1669906892984.png

 

you can use it as a measure or in other measures

Mikelytics_4-1669907085404.png

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

2 REPLIES 2
Mikelytics
Resident Rockstar
Resident Rockstar

HI @BuistJF 

 

You can use a numerica parameter:

Mikelytics_0-1669906756932.png

 

Mikelytics_1-1669906856412.png

Mikelytics_2-1669906892984.png

 

you can use it as a measure or in other measures

Mikelytics_4-1669907085404.png

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

 

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Lengend, thank you @Mikelytics . Didnt need to create the additonal measure, was able to append the auto created one. Dax endded up looking as follows:

2 Month Act =
CALCULATE (
    AVERAGEX ( DSET_3_Month, DSET_3_Month[Activate Count] ),
    DATESINPERIOD (
        DSET_3_Month[Date],
        LASTDATE ( DSET_3_Month[Date] ),
        'Moving Month Parameter'[Parameter Value],
        MONTH))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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