cancel
Showing results for
Did you mean:  ## % of participation

Good, I'm new to dax but I have a little doubt, I would like to get the percentage of participation from a table, I already have the measures of countingdifferent for the total, but I would like a measure to calculate by its type of "form of payment" and after having calculated it, take your percentage

For the calculation by category I had this idea

PO Count by Payment Method = CALCULATE(DISTINCTCOUNTNOBLANK('2023'[Bigmagic Purchase Order ID]),GROUPBY('2023','2023'[Payment method]))
But when I want to use that same measure to calculate the % of participation I get 100% in all
In the table I detail my doubt also 1 ACCEPTED SOLUTION  Community Support

According to your description, you want to get the percentage of participation from a table.

Here are the steps you can refer to :
(1)This is my test data : i create a measure to simulate yours.

``Measure = SUM('Table'[Value])``

(2)Then wen can create two measures like this if one can help you :

``````Percentage = var _total = SUMX( ALLSELECTED('Table'[Payment method]) , [Measure])
return
DIVIDE([Measure],_total)``````
``````Percentage without null = var _total = SUMX(FILTER( ALLSELECTED('Table'[Payment method]) ,[Payment method]<> BLANK()) , [Measure])

return
IF(MAX('Table'[Payment method])=BLANK(),BLANK(),
IF( HASONEVALUE('Table'[Payment method]),
DIVIDE([Measure],_total) ,1))``````

The result is as follows: If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

2 REPLIES 2  Thank you very much for the help! I just implemented the measures and it has worked!  Community Support

According to your description, you want to get the percentage of participation from a table.

Here are the steps you can refer to :
(1)This is my test data : i create a measure to simulate yours.

``Measure = SUM('Table'[Value])``

(2)Then wen can create two measures like this if one can help you :

``````Percentage = var _total = SUMX( ALLSELECTED('Table'[Payment method]) , [Measure])
return
DIVIDE([Measure],_total)``````
``````Percentage without null = var _total = SUMX(FILTER( ALLSELECTED('Table'[Payment method]) ,[Payment method]<> BLANK()) , [Measure])

return
IF(MAX('Table'[Payment method])=BLANK(),BLANK(),
IF( HASONEVALUE('Table'[Payment method]),
DIVIDE([Measure],_total) ,1))``````

The result is as follows: If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly  