cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

Helper II
Helper II

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

Super User IV
Super User IV

@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/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors