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
saranp780
Helper III
Helper III

How can I count only different row?

I have a lot of data on computer hardware. So my requirement is I would like to compare the data that I exported text from the script. and the data are automatically running.   The data that I have now should be like this.



NameSurnameCPURAMMonitorGPU
JoshuaSalosIntel Core i7-870015.99 GBSamsung 21.5"Intel UHD 620
KlausMikaelsonAMD Ryzen3 3200G32.00GBMSI 27"AMD Radeon X570
TomYSSAMD Ryzen5 360016.00GBMSI 24.8"Nvidia Geforce 1660 TI
StefenSalvatoreIntel Core i7-9750H16.00GBLenovo 21.5"Nvidia Geforce 2070 
JoshuaSalosIntel Core i7-870032.00 GBSamsung 21.5"Intel UHD 620
KlausMikaelsonAMD Ryzen3 3200G32.00GBMSI 27"AMD Radeon X570
TomYSSAMD Ryzen9 3900X16.00GBMSI 24.8"Nvidia Geforce 1660 TI
StefenSalvatoreIntel Core i7-9750H16.00GBLenovo 21.5"Nvidia Geforce 2070 





How can I count only different Hardware row and only show with DAX like below? 



Count: 2 Different rows.

JoshuaSalosIntel Core i7-870015.99 GBSamsung 21.5"Intel UHD 620
JoshuaSalosIntel Core i7-870032.00 GBSamsung 21.5"Intel UHD 620
TomYSSAMD Ryzen5 360016.00GBMSI 24.8"Nvidia Geforce 1660 TI
TomYSSAMD Ryzen9 3900X16.00GBMSI 24.8"Nvidia Geforce 1660 TI



Just Count only different rows. Don't count the same rows. In my example data, the row different are 2.  And when I click on 2 it can be shown the text.

Thank you every reply.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @saranp780 ,

First you should know that the interactions between card visual and other visuals are single diretion, the card visual only shows the aggregated value so that when we click on it it will not interact with any visual.

In this case, to achieve your requirements, you can try to create these measures:

Create one measure to show ‘2’ result in the card visual:

Count = 
VAR tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'Table' ),
            COUNTX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Name] = EARLIER ( 'Table'[Name] )
                        && 'Table'[CPU] = EARLIER ( 'Table'[CPU] )
                        && 'Table'[RAM] = EARLIER ( 'Table'[RAM] )
                        && 'Table'[Monitor] = EARLIER ( 'Table'[Monitor] )
                        && 'Table'[GPU] = EARLIER ( 'Table'[GPU] )
                ),
                [Name]
            ) = 1
        ),
        [Name]
    )
RETURN
    COUNTX ( FILTER ( tab, [Name] IN DISTINCT ( 'Table'[Name] ) ), [Name] )

Create another measure to filter the table visual, set its value as 1 and put it in the visual filter:

visual control =
IF ( NOT ( ISBLANK ( [Count] ) ), 1, 0 )

vc.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
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

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @saranp780 ,

First you should know that the interactions between card visual and other visuals are single diretion, the card visual only shows the aggregated value so that when we click on it it will not interact with any visual.

In this case, to achieve your requirements, you can try to create these measures:

Create one measure to show ‘2’ result in the card visual:

Count = 
VAR tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'Table' ),
            COUNTX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Name] = EARLIER ( 'Table'[Name] )
                        && 'Table'[CPU] = EARLIER ( 'Table'[CPU] )
                        && 'Table'[RAM] = EARLIER ( 'Table'[RAM] )
                        && 'Table'[Monitor] = EARLIER ( 'Table'[Monitor] )
                        && 'Table'[GPU] = EARLIER ( 'Table'[GPU] )
                ),
                [Name]
            ) = 1
        ),
        [Name]
    )
RETURN
    COUNTX ( FILTER ( tab, [Name] IN DISTINCT ( 'Table'[Name] ) ), [Name] )

Create another measure to filter the table visual, set its value as 1 and put it in the visual filter:

visual control =
IF ( NOT ( ISBLANK ( [Count] ) ), 1, 0 )

vc.png

Attached a sample file in the below, hopes to help you.

 

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

Anonymous
Not applicable

I suggest to put the appropriate columns together and use for instance DISTINCTCOUNT(). The question is what you really want to achieve?

amitchandak
Super User
Super User

@saranp780 , Logic of split is not clear. Can you explain

 

You can try to unpivot in power query

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

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.