The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to 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:
In the pbix file I have taken the Month from financial Year table assuming thats your date table.
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. 😊
Can anyone help me out.
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 :
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.😊
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.
@NadeemAhamed
Could you share the measure you want to use this value in ?
I could help you make changes in it.
1. First Measure:
Selected month = FORMAT(SELECTEDVALUE('month'[Month]),"MMM")
2. Second Measure:
Demo=
Hi @NadeemAhamed ,
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:
In the pbix file I have taken the Month from financial Year table assuming thats your date table.
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. 😊