Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have a Table where Code is unique.
I would like to get a division of stock by count of Group values please
Eg.
Stock = 40, count of Jeans=2 so 40/2=20
Code | Group | stock | Result I would like to get |
101 | Jeans | 40 | 20 |
102 | Jeans | 40 | 20 |
103 | Suits | 60 | 20 |
104 | Suits | 60 | 20 |
105 | Suits | 60 | 20 |
106 | Shoes | 10 | 10
|
Thank You
Solved! Go to Solution.
Hi @MasterSonic
please try
CalculatedColumn =
DIVIDE (
'Table'[Stock],
COUNTROWS ( CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Group] ) ) )
)
you may also try
Column=
VAR CurrentGroup = TableName[Group]
VAR CurrentStockType = TableName[Stock]
VAR CurrentGroup =
COUNTROWS(
FILTER(
TableName,
TableName[Group] = CurrentStockType
)
)
RETURN
DIVIDE ( CurrentGroup, CurrentGroup )
Hi there,
I did try your solution and have an issues.
Shouldn't be second
VAR CurrentGroup
Different name like CurrentGroup2 ?
I have error about that.
I did change it , but still showing that can not transform values from Group of type text into number
Hi @MasterSonic
please try
CalculatedColumn =
DIVIDE (
'Table'[Stock],
COUNTROWS ( CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Group] ) ) )
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |