cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahuhn Regular Visitor
Regular Visitor

Use parameter in measure

I have a simple dataset

 

StatusMonthUpdated
Alpha201810
Alpha201810
Beta201810
Gamma201810
Delta201809
Alpha201809
Alpha201809
Alpha201808

 

What I want to do is create two parameters so the user can find the difference in counts between two months. I want the user to select month1 = their choice (preferaby from a table or dropdown), select month2 = their choice as well. ie difference between 201810 and 201809 for Alpha status is 0, but 201810 and 201808 is 1

 

So far, I tried:

 

1) Measure = CALCULATE(COUNT(Sheet1[Status]),FILTER(Sheet1,[MonthUpdated]=YYYYMM && [Status]="Alpha")), but this does not update when I change the parameter value YYYYMM via home --> edit queries --> edit parameters

 

2)  Following from https://community.powerbi.com/t5/Desktop/use-parameters-in-dax/m-p/536964/highlight/false#M251956 does not work, as this uses slicers, and after selecting for one month via a slicer table, the second selection is limited to the value of the first slicer,

 

3) Following https://community.powerbi.com/t5/Desktop/Use-parameter-in-measure/m-p/349842#M157174 failed because the what-if parameter permits only continuous numeric values.

 

Suggestions are most appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Use parameter in measure

I would use two disconnected tables with your values and two slicers. Use MAX to grab the value of your slicer. You could create your tables by using something like:

 

Table1 = DISTINCT('Table'[MonthUpdated])

Table2 = DISTINCT('Table'[MonthUpdated])

 

Don't relate them to anything.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

Re: Use parameter in measure

I would use two disconnected tables with your values and two slicers. Use MAX to grab the value of your slicer. You could create your tables by using something like:

 

Table1 = DISTINCT('Table'[MonthUpdated])

Table2 = DISTINCT('Table'[MonthUpdated])

 

Don't relate them to anything.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors