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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
BIswajit_Das
Resolver III
Resolver III

power bi visual

I have a table like

id  y  z

1  a  a

1  b  a

1  a  a

2  a  a

3  b  b

And i need to create a visual like

for a                                  for b

2/3                                    1/3 

Here 2 is the count of z value and 3 is the count of id means total distinct id

Is there any way to do this??

 

For Example : BIswajit_Das_0-1677828683460.png

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi  @BIswajit_Das ,

It need to make a little adjustment as below for the measure, please find the details in the attachment.

Measure = 
VAR _selvalue =
    SELECTEDVALUE ( 'Z'[z] )
VAR _countx =
    DISTINCTCOUNT ( 'Table'[x] )
VAR _countz =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[x] ),
        FILTER ( 'Table', 'Table'[z] = _selvalue )
    )
RETURN
     _countz&"/"& _countx

yingyinr_1-1677829989080.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi  @BIswajit_Das ,

It need to make a little adjustment as below for the measure, please find the details in the attachment.

Measure = 
VAR _selvalue =
    SELECTEDVALUE ( 'Z'[z] )
VAR _countx =
    DISTINCTCOUNT ( 'Table'[x] )
VAR _countz =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[x] ),
        FILTER ( 'Table', 'Table'[z] = _selvalue )
    )
RETURN
     _countz&"/"& _countx

yingyinr_1-1677829989080.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.