Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a measure that calculates sales, this can be filtered based on store or salesperson etc...
This then goes in a histogram showing distribution of stores or employees based on sales.
User can select a store from a slicer.
I want to create a measure that will return a count of stores that fall within an arbitrary bin size (lets say max sales is 100$ and min is 0, with bin size of 10) for the sales of the store that the user selected.
For example, user selects a store with sales of 73$, I want a count of all stores that fall within 70 and 80$ of sales.
Is it possible to reference a measures value given a slicer within another measure?
Thank you.
Solved! Go to Solution.
After further thought, I have found a way to do this for anyone else experiencing the same problem:
In the measure that you want to reference the filter context value of another measure you must first have a disconnected slicer, store the selected value in a var, then create a temp table using summarize and add a new column that contains the measure you want, then sum that table which will have only one row. Then that third var will contain the value within filter context.
This works of course only for single select filter but that was my use case.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
@Ritaf1983, Due to the nature of the data and my employer, I can't share it. However if absolutely necessary, I can create a sample dataset that reflects similar functionality.
However, I think my question is pretty straight forward and doesnt depend on data. I simply want to know if it is possible to extract the value of a measure in a given filter context within dax code. If I have a table with 100 rows and two columns, first column being the store ID of 10 stores (multiple entries for each store) and second column being sales, I can write a measure such as sum or average of sales. This will then give me some summary of sales but can be aggregated by store with a slicer in the UI. Can I extract the sum or average sales for one store within the code for another measure?
Similar to a pandas groupby if anyone is familiar with python.
If this alone is not enough explanation of my problem then I figure it is not possible.
Thank you.
After further thought, I have found a way to do this for anyone else experiencing the same problem:
In the measure that you want to reference the filter context value of another measure you must first have a disconnected slicer, store the selected value in a var, then create a temp table using summarize and add a new column that contains the measure you want, then sum that table which will have only one row. Then that third var will contain the value within filter context.
This works of course only for single select filter but that was my use case.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |