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
Niemeyer
Regular Visitor

Counting accumulated lines

Hello,

Niemeyer_0-1678278231884.png

the ABC analysis shows the summed turnover per customer group.
These can change through different filters.
I would now like to count how many rows A, B or C are displayed.
So in this case
A = 2
B = 3
C = 4

The values A, B and C were previously determined in a measure.

No matter what I have tried with COUNT, everything in the table is counted, but not the displayed rows.

Does anyone have a tip?

 

Best regards

Volker

 

1 ACCEPTED SOLUTION

8 REPLIES 8
Niemeyer
Regular Visitor

Perfect, thank you very much 🙂

@Niemeyer 
Also check the other solution if you are interested in summing the values at the total level (as in the first solution it shows 0)

tamerj1
Super User
Super User

Hi @Niemeyer 
Create a disconnected table (let's call it ABC) which contains the 3 values A, B, & C in a single column. Place the column in a table visual along with the following measure

Count =
SUMX (
    VALUES ( 'Table'[Kundengruppe / Kunde] ),
    INT ( [Umsatz ABC] = SELECTEDVALUE ( ABC[Value] ) )
)

Thanks for the suggestion, here is the result.

Niemeyer_0-1678281825035.png

All rows of the source table are counted as C?

We were already that far 😉

Please note that it is not the source table that is counted but the displayed, grouped, summed and filtered visual.

 

@Niemeyer 
Please make sure that no relationships have been automatically created by power bi. 
also please share the dax that you have used.  

I have provided the anonymous evaluation (pbix) with test data here:

https://1drv.ms/u/s!AnOtUz8wrIZqmrId12FdCAGJabRSyg?e=puOZpX

@Niemeyer 
Or with total if required

2.png

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.