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.
Hi
I have table like this below and would like to get the key values or totals of each in seperate table
TLName | product | count |
A | abc | 0 |
A | cba | 0 |
A | sdf | 1 |
A | sgdg | 0 |
B | rsdf | 1 |
B | uiyuiu | 1 |
B | rwe | 0 |
B | yiuy | 1 |
C | mnbmn | 1 |
C | ouio | 1 |
C | tetr | 1 |
Need total table like this
TLName | product | count | percentage |
A | 4 | 1 | 25% |
B | 4 | 2 | 50% |
C | 3 | 3 | 100% |
Solved! Go to Solution.
Hi @mahaboobpathan ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table.
Table 2 =
DISTINCT (
SELECTCOLUMNS (
'Table',
"TLName", 'Table'[TLName],
"product", COUNTROWS ( FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) ) ),
"count",
CALCULATE (
SUM ( 'Table'[count] ),
FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) )
),
"percentage",
DIVIDE (
CALCULATE (
SUM ( 'Table'[count] ),
FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) )
),
COUNTROWS ( FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) ) ),
0
)
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mahaboobpathan ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table.
Table 2 =
DISTINCT (
SELECTCOLUMNS (
'Table',
"TLName", 'Table'[TLName],
"product", COUNTROWS ( FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) ) ),
"count",
CALCULATE (
SUM ( 'Table'[count] ),
FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) )
),
"percentage",
DIVIDE (
CALCULATE (
SUM ( 'Table'[count] ),
FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) )
),
COUNTROWS ( FILTER ( 'Table', 'Table'[TLName] = EARLIER ( 'Table'[TLName] ) ) ),
0
)
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |