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.
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
Solved! Go to Solution.
Hi , @Syndicate_Admin
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
Thank you very much for the help! I just implemented the measures and it has worked!
Hi , @Syndicate_Admin
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
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |