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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
NadeemAhamed
Helper V
Helper V

how to fetch the values from the slicers and apply in condition in measures

Dear Community.

Good Day.

 

I have created one slicers for month from the one table, i want to apply the same month in my measures condtion

Ex: I have Slicer with the months Apr-Mar 

If i have selected any one month (Sep) then the same values should be apply in DAX.

 
Iam using the below measures but i want to apply the selected month in the place of "Sep"
demo =
 CALCULATE(SELECTEDVALUE('tablename'[columnname]),''tablename'[columnname_month])="Sep" && '('tablename'[columnname_month2])="Sep")
1 ACCEPTED SOLUTION

Hi @NadeemAhamed ,
Thanks for the data and pbix. 
So we need to display data where both month and monthly base is the selected month.

I have tried on the Plan values:

Gayatri_D05_0-1709531283530.png


In the pbix file I have taken the Month from financial Year table assuming thats your date table.

Gayatri_D05_1-1709531341913.png

The data is matching, the measure i have used is :

Plans =
var _mon = FORMAT(SELECTEDVALUE('Financial Year'[Month]),"MMM-YY")
return
CALCULATE(SUM(Testing[Plan]),FILTER(Testing,Testing[Month] = _mon && Testing[Monthly base] = _mon))


If your requirement is solved, please make THIS ANSWER as SOLUTION and help other users find the solution quickly. Please hit the LIKE button if this comment helps you. 😊

View solution in original post

8 REPLIES 8
NadeemAhamed
Helper V
Helper V

Can anyone help me out. 

Gayatri_D05
Resolver II
Resolver II

Hi @NadeemAhamed ,
In order to use the selected month in the slicer you can use the following measure anywhere in your other measures for calculation.

Selected month = FORMAT(SELECTEDVALUE('month'[Month]),"MMM-YY")

I tried it on a sample data :

Gayatri_D05_0-1709274709403.png

If your requirement is solved, please make THIS ANSWER as SOLUTION and help other users find the solution quickly. Please hit the LIKE button if this comment helps you.😊

 

@Gayatri_D05 

 

Thank you for your valuable time to read and understand 

 

After this measures creation, iam not able to pass this measures or variable in condition. 

 

I tried with multiple options but bad luck its not working.
could you help me to achive this.

@NadeemAhamed 
Could you share the measure you want to use this value in ?
I could help you make changes in it.

@Gayatri_D05 

 

1. First Measure:

Selected month = FORMAT(SELECTEDVALUE('month'[Month]),"MMM")

 

2. Second Measure:

Demo=

 CALCULATE(SELECTEDVALUE('Tablename1'[column]),'Tablename1'[Filterculumn1]="Sep" && 'Tablename1'[Filterculumn2]="Sep")
 
I need to place the selected month values in the values of "Sep" so that it will become dynamic values.

Hi @NadeemAhamed ,

What exactly are you trying to achieve with the Demo measure ?
I am not able to understand. Could you share sample data and your motive of the measure ?


@Gayatri_D05 

 

Thank your for reply. 

 

I have attached the pbix file and excel file for your reference. 

Excel : https://toyotsu.box.com/s/6h12dtocuo4k7yvpixed6p8oy45uiv4l

Pbix: https://toyotsu.box.com/s/hrywd6ywmjsynjpird2pqsku9k5lthds

 

I have 2 colums for the month, 1st one is monthly base and another one is month. 

I have Division column as well. 

I want to apply filtration for the month and Divison. 

For the Divsion filration is workig fine, as i have 2 month column i am not able to get the exact data. 

so iam trying to create one measure where i will pass filrated month in condition.

SQL query: select plan, actual, variance from testing where monthly base= "Selected Month" and month="Selected Month"

 

Hi @NadeemAhamed ,
Thanks for the data and pbix. 
So we need to display data where both month and monthly base is the selected month.

I have tried on the Plan values:

Gayatri_D05_0-1709531283530.png


In the pbix file I have taken the Month from financial Year table assuming thats your date table.

Gayatri_D05_1-1709531341913.png

The data is matching, the measure i have used is :

Plans =
var _mon = FORMAT(SELECTEDVALUE('Financial Year'[Month]),"MMM-YY")
return
CALCULATE(SUM(Testing[Plan]),FILTER(Testing,Testing[Month] = _mon && Testing[Monthly base] = _mon))


If your requirement is solved, please make THIS ANSWER as SOLUTION and help other users find the solution quickly. Please hit the LIKE button if this comment helps you. 😊

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors