Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bcobrien1977
Helper IV
Helper IV

Dynamic Legend Based upon Slicer- Error Counting

Hi,

I have a visual where I want the user to select either the Requesting Side or Receiving Side and then be able to get a count of the items. 

I have a table that has all of the exhaustive list of requesting and receiving VS/SS and basically I want the chart to update with what I select and have the correct count.

 

My problem is that the below measure is saying that it can't convert the VS/SS A to be a true false and I am getting an error on the count. 

 

 

AttributeVS/SS
Requesting SideA
Requesting SideA
Requesting SideA
Requesting SideA
Requesting SideA
Receiving SideB
Receiving SideB
Receiving SideB
Receiving SideB
Receiving SideB

 

 

 

I created a measure 

Unique Counts =
VAR SelectedType =
    SELECTEDVALUE('Axis Table'[Attribute])
VAR Selected_Value =
    VALUES ('Axis Table'[Value Stream/Shared Service])
RETURN
    SWITCH (
        SelectedType ,
        "Receiving Side", CALCULATE ( DISTINCTCOUNT(vwJiraDependencies_UAT[IssueKey] ), 'RECEIVING SIDE'[Receiving Side] IN Selected_Value),
        CALCULATE ( DISTINCTCOUNT(vwJiraDependencies_UAT[IssueKey] ), 'REQUESTIING SIDE'[Requesting Side]
 
Any insight on how to do this would be greatly appreciated. The Attribute table and the main table are connected. 
Thanks
 
 
 
1 ACCEPTED SOLUTION

IssueRequestingReceiving
1AB
2AB
3CA
4DA
5CD
6BC
7DA
8BC
9DA

 

 

Basically I want to be able to filter on either receiving or requesting side  and show the Attrbiute

Example show me receiving and pick Attribute A and get the copy of B, C, D, etc.   I am getting an error that the text can't be converted to true/false.  If you don't mind sharing the PBIX file, that would be great.

Thanks!

View solution in original post

6 REPLIES 6
bcobrien1977
Helper IV
Helper IV

Can you attach your file?  There is something that I am missing.

@bcobrien1977 Sure! Please find attached.

ghoshabhijeet
Solution Supplier
Solution Supplier

@bcobrien1977  Thanks for providing the sample data.


Here is my solution:

 

Steps:

 

1. Unpivot the main data table for the Receiving and Requesting column. The table should look like this after Unpivot:

ghoshabhijeet_1-1684272001908.png

 

2. Create the relationship between the two tables. The data model should look like this.


ghoshabhijeet_0-1684271912623.png

 

3.  Create a measure for Unique Count:


Unique Count =
CALCULATE (
COUNT ( 'Issue Table'[Value] ),
'Issue Table'[Value] = SELECTEDVALUE ( 'Issue Table'[Value] )
)

4. Create a slicer and chart in the Report. The visual should look like this:

ghoshabhijeet_5-1684272229195.png

 

 

ghoshabhijeet_4-1684272213588.png

Hope this helps.

 

 

** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !

Good Luck 👍

 

Thanks.  I am assuming that your attribute table literally has two rows, 1 receiving and 1 requesting? Otherwise you have a many to many relationship.

ghoshabhijeet
Solution Supplier
Solution Supplier

@bcobrien1977  Thanks for your query. Can you please provide some dummy data of your main table. Would be easier to build the calculation. Thanks !

IssueRequestingReceiving
1AB
2AB
3CA
4DA
5CD
6BC
7DA
8BC
9DA

 

 

Basically I want to be able to filter on either receiving or requesting side  and show the Attrbiute

Example show me receiving and pick Attribute A and get the copy of B, C, D, etc.   I am getting an error that the text can't be converted to true/false.  If you don't mind sharing the PBIX file, that would be great.

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.