Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have two slicers, one is YEAR and one is ID. If the slicer values selected match the year and ID in a table, I want to return the associated AMT. Something like this:
I created a measure for the selected ID and Selected Year
I have tried using a measure and a new column. This is the code I used for the new column:
Solved! Go to Solution.
I actually figured it out. I had to join my 2 tables on 2 columns and that fixed the issue!
Hi @pegmoran ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya
Hi @pegmoran ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya
Hi @pegmoran ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya
I actually see the post (post 5) 🙂
Im sorry, I had replied a week or so ago but apparently it didn't post. I ended up solving this on my own! I appreciate the help!
Thank you, unfortunately that code returns no values for AdminShare
I did create a measure for the selected year and the selected ID and can see they are populated correctly. Would there be a way to use those measures in a statement that basically says if the 'year measure' matches the year in Table2 and the 'ID measure' matches the ID in Table 2, display the Amount?
Hi @pegmoran ,
can you check the below points to overcome the your issue.
AdminShare =
CALCULATE(
MAX(Table2[Amount]), -- Change MAX to SUM or AVERAGE depending on your business logic
FILTER(
Table2,
Table2[Year] = [SelectedYear] &&
Table2[ID] = [SelectedID]
)
)
3.[SelectedYear] and [SelectedID] should be measures, often created using SELECTEDVALUE() to retrieve user input from slicers
SelectedYear = SELECTEDVALUE('YearTable'[Year])
SelectedID = SELECTEDVALUE('IDTable'[ID])
4.If the slicers are based on fields from other tables (e.g., YearTable, IDTable), make sure those tables have a relationship to Table2.
5.If no relationship exists between Table2 and your selection tables:
6.The measure will not filter properly. Consider creating relationships in the model (from YearTable[Year] to Table2[Year] and IDTable[ID] to Table2[ID]).
Regards,
Chaithanya.
Hi @pegmoran ,
Thank you for reaching out to Microsoft Fabric Community Forum.
Below are the few steps that will resolve your issue let us know if you need anything else.
1)Create the slicers Make sure you have slicers for:
-MYTABLE[Year]
-MYTABLE[ID]
2)create the below measure
AdminShare =
VAR SelectedYear = SELECTEDVALUE(MYTABLE[Year])
VAR SelectedID = SELECTEDVALUE(MYTABLE[ID])
RETURN
CALCULATE(
MAX(MYTABLE[Amt]),
MYTABLE[Year] = SelectedYear,
MYTABLE[ID] = SelectedID
)
3)If your slicers come from different tables, make sure those tables are related to MYTABLE
Regards,
Chaithanya.
Hi @pegmoran
Here, all of them Columns ( ID, Year and Amt ) are in the same table ( My_Table ). So creating the measures for Selected_ID and Year are not required. Simply creating the measure and selecting the required items in the slicer should work.
Basically,
Amount = SUM ( MyTable[Amt] )
If you pull in the measure, with a certain ID selected && certain Year selected , this should work. Let me know if this works
I actually figured it out. I had to join my 2 tables on 2 columns and that fixed the issue!
I agree if this was a standalone process. I'm actually adding it to a table that exists and in sql it was a subquery, So leaving as is, it creates multiple rows and values, where it should just add to an existing row on the ID (i know it's a "joining" type issue)
Would you be okay to share the source file on which you are working right now and preferably the image of what you'd want the end product to look like? Thanks
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
10 | |
10 | |
8 | |
7 |