cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pstanek Post Patron
Post Patron

Measure with parameter

Is it possible to create measure with  Parameter.

For example

pcena  = Calculate(
SUM(movement[pcena]);
FILTER(movement; movement[date] >= DATE(2016;3;14) && movement[date] <=DATE(2016;4;30)))

If I want to change dates, I will have to create another measure.

It would be nice to have 

pcena(start,end)  = Calculate(
SUM(movement[pcena]);
FILTER(movement; movement[date] >= start && movement[date] <=end)).

 

Evaluation would be

pcena(DATE(2016;3;14) ,DATE(2016;4;30)).

 

4 REPLIES 4
Nhallquist Helper V
Helper V

Re: Measure with parameter

Have you tried using a Slicer for this?  There is a custom Visual that will most likely help you out on this.  You can down load the custom visual here.  To learn more about the Timeline Slicer, you can read about it here

 

Also, if you want this parameter to only influnce one visual, then you can use the Visual Interactions options to control that as well.

Visual Interactions.GIF

 

Hope this helps,

 

Nate

Sean Community Champion
Community Champion

Re: Measure with parameter

@pstanek Easiest thing to do is to drag your [Date] field to either the Visual or Page Level Filter

 

This way you can change the Date range for only the selected Visualization or the whole page

 

then click advanced filtering and select the dates from the calendar

Date Filter.png

 

 

pstanek Post Patron
Post Patron

Re: Measure with parameter

No, I am a beginner. I think It can be usefull. I guess it will only work for time parameters. I am keen to see, if  can be used separatety for each page within the report.

But thanks,  very much.

Highlighted
Microsoft v-caliao-msft
Microsoft

Re: Measure with parameter

Hi Pstanek,

 

According to your description, you need to add parameters to the DAX expression when creating a measure, right?

 

Based on my research, referencing parameters is currently supported via the Data Source dialogs, Filter Rows, Keep Rows (top/bottom, etc.), Remove Rows (top/bottom, etc.) and Replace Values. So it seems that it is not supported to use a parameter in measure.
https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-april-update-feature-summary/

 

If you have any concern on this feature, you can submit your idea on the link below. If this feature was mentioned by mulitple users, product team will consider to add this feature to next release.
https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Regards,

Charlie Liao

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors