The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I want to achieve for a particular ticket if I select or filter from Group it should show avergae of Amount. Example
for ticket 111, if a is selected value should show as 0.01, if b is selected value should show 0.07 and show on
Ticket | Group | Amt | Ticket Indexing |
111 | A | 0.01 | 1 |
111 | B | 0.07 | 2 |
111 | C | 1.15 | 3 |
111 | A | 1.18 | 4 |
112 | B | 1.23 | 1 |
112 | C | 1.15 | 2 |
112 | D | 0.07 | 3 |
Solved! Go to Solution.
Hello @Sriku,
Thank you for reaching out to the Microsoft Power BI Community.
Based on your query, you wanted to calculate the average of the Amt column for a selected Group and Ticket combination. You've now successfully implemented the measure using the following DAX expression:
Selected Group Avg Amt =
CALCULATE(
AVERAGE(Sheet1[Amt]),
FILTER(
Sheet1,
Sheet1[Group] IN VALUES(Sheet1[Group])
)
)
To allow users to interact with the data, add a slicer for the Group column (A, B, C, D). This slicer will filter the data based on the selected group, affecting the Selected Group Avg Amt measure. Then, add a table visual with the Ticket field to categorize rows and display the Selected Group Avg Amt to show the average amount for each ticket, based on the group selection. This enables dynamic insights into how Amt values vary by ticket and group.
Additionally, I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.
If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!
Thank you.
Hello @Sriku,
Thank you for reaching out to the Microsoft Power BI Community.
Based on your query, you wanted to calculate the average of the Amt column for a selected Group and Ticket combination. You've now successfully implemented the measure using the following DAX expression:
Selected Group Avg Amt =
CALCULATE(
AVERAGE(Sheet1[Amt]),
FILTER(
Sheet1,
Sheet1[Group] IN VALUES(Sheet1[Group])
)
)
To allow users to interact with the data, add a slicer for the Group column (A, B, C, D). This slicer will filter the data based on the selected group, affecting the Selected Group Avg Amt measure. Then, add a table visual with the Ticket field to categorize rows and display the Selected Group Avg Amt to show the average amount for each ticket, based on the group selection. This enables dynamic insights into how Amt values vary by ticket and group.
Additionally, I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.
If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!
Thank you.
Hi @Sriku,
we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
If our response addressed by the community member for your query, please mark it as Accept Answer and give us Kudos. Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!
Hi @Sriku ,
To achieve the behavior you're describing in Power BI—where selecting a specific Group filters the result to show the average Amt for that group and ticket—you can create a DAX measure that respects both the Ticket and the Group filter context. The measure uses the CALCULATE function along with ALLEXCEPT to preserve filtering by Ticket and Group only, regardless of other filters that might exist in the visual or report. Here's how the DAX formula would look:
Selected Group Amt =
CALCULATE(
AVERAGE('Table'[Amt]),
ALLEXCEPT('Table', 'Table'[Ticket], 'Table'[Group])
)
This measure ensures that when a user selects a Group, the visual will reflect the average Amt for that group within the context of each Ticket. So for example, if Ticket 111 is in the visual and you select Group A, the measure would return the average of the two rows for Group A under Ticket 111, which is (0.01 + 1.18) / 2 = 0.595. If you prefer to simply calculate the average of the currently filtered group without any ALLEXCEPT logic, you can simplify the measure as follows:
Selected Group Amt = AVERAGE('Table'[Amt])
This version works best when you are filtering the Group through a slicer and don't need to maintain multiple filter contexts.
Best regards,
@DataNinja777 , Basically I want to filter each row of indivual ticket and show based on selected item in group, for that I have created ticket indexing. any other way to show it.
Hi @Sriku,
Thanks for the follow-up!
Since you're aiming to filter each individual row of a ticket based on a selected group — and you're already using Ticket Indexing — here's a more targeted approach:
Currently, Power BI doesn't allow dynamic filtering within the same visual row purely based on selection without slicers or user interaction. However, instead of relying on indexing, you can achieve your goal by leveraging a DAX measure that reacts to Group selection and compares it per row:
Try this Dax Measure:
Show Selected Amt =
IF(
'Table'[Group] = SELECTEDVALUE('Table'[Group]),
'Table'[Amt],
BLANK()
)
It ensures that only the rows where the Group column matches the selected value (from a slicer or visual interaction) will display the amount. All other rows will return blank, effectively filtering the visual on a per-row basis without the need for Ticket Indexing.
Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.
Thank you.