Forum Discussion
Anonymous
4 years agoNot applicable
Calculate percent based on multiple columns
Hello, Is it possible to calculate percentage when MARA-MTART, LOCATIONTYPE and LOCATIONID are the same - like the example below. So adding an extra column calculating the percentage where the t...
- 4 years ago
Hi Anonymous ,
IF the "Mat Nr Count" is a measure, you can modify M like this.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Fowmy
Super User
4 years agoAnonymous
Can you try the following Measure:
M =
DIVIDE (
CALCULATE ( DISTINCTCOUNT ( TableName[MatNr] ) ),
SUMX (
ADDCOLUMNS (
CALCULATETABLE (
TableName,
ALLEXCEPT (
TableName,
TableName[MARA-MTART],
TableName[LOCATIONTYPE],
TableName[LOCATIONID]
)
),
"DC", CALCULATE ( DISTINCTCOUNT ( TableName[MatNr] ) )
),
[DC]
)
)
- Anonymous4 years agoNot applicable
Hi Fowmy,
Thank you for your response. Unfortunately it doesn't calculate correctly.
The "M" should calculate like "Frequency" in this example as I've put in my filters based on the three first columns:
- Fowmy4 years ago
Super User
Anonymous
Create a sample Power BI file with dummy data and share the link here. You can save in Google drive.- Anonymous4 years agoNot applicable