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.
Hello Experts
I have a Sitution here,where i need to highlight Matching values b/w 2 table Visuals and Provide a filter to the User where he/she can filter the Matching & Unmatching Values in table Visual.
Please suggest me DAX measure to achive this, i tried some but not giving results as required.
To highlight matching values between two tables that are not directly connected in Power BI and provide a filter to allow users to toggle between matching and non-matching values, you can use DAX measures and a slicer. Here's a step-by-step guide on how to achieve this:
Let's assume you have two tables: Table1 and Table2, and you want to highlight matching values from Table1 in a table visual and provide a filter to show matching and non-matching values.
Create a Measure to Identify Matching Values: Create a DAX measure that calculates a value for each row in Table1 based on whether it exists in Table2. This measure will return 1 for matching values and 0 for non-matching values. You can use the RELATED and COUNTROWS functions for this:
MatchingFlag = IF(COUNTROWS(FILTER(Table2, Table2[CommonColumn] = EARLIER(Table1[CommonColumn]))) > 0, 1, 0)
Replace [CommonColumn] with the actual common column between the two tables.
Create a Slicer: Add a slicer visual to your report. In this slicer, you can create a new measure that allows users to switch between matching and non-matching values. The measure might look like this:
ShowMatching = SELECTEDVALUE('Slicer'[Value], "All")
In this slicer, you can have three options: "All," "Matching," and "Non-Matching." Users can choose one of these options to filter the table.
Filter the Table Visual: Now, go to the table visual where you want to highlight the matching values. Apply filters based on the value selected in the slicer.
For matching values:
FILTER(Table1, [MatchingFlag] = 1)
FILTER(Table1, [MatchingFlag] = 0)
For showing all values, you don't need to apply any additional filter.
Use the Slicer: Users can now select "All," "Matching," or "Non-Matching" from the slicer to see the corresponding values in the table visual.
By following these steps, you can highlight matching values between two tables that are not directly connected and provide a filter for users to toggle between matching and non-matching values in a table visual.
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
14 | |
14 | |
9 | |
7 |