cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## DAX in PIVOT to Return one valor of the Exclusion

Hello There!
I need a hand in this problem:
General Context: The company ask me to creat in Excel a Sheet for the use of ours selling team, and for this I'm using Query, Pivote and Visualization.
Problem Context: There is some Measures, like the one down bellow, that some of the ID's cant be considered, as they are the Team Leaders, T.I Support and its Testes or even some other non comercial seller, so my sollution was: Creat a range of ID's that I would with the function "IF" transfor in blank.

THE PROBLEM: It in indeed work, but only if the Team leaders are filtered, so if I want to see every one of the sector, I Cant, as the Excel return the saying:

-----------------------------------------------------------------------------------------------------------------------------------------------

"MdxScript(Model) (17,58) Error in the measure calculation 'dMeta'[Positivação (Und)]]: A table of many values was delivered, and only one value was expected."*

-----------------------------------------------------------------------------------------------------------------------------------------------

*Free translation of portuguese to english

This one bellow is my DAX (in Pivot), some terms that are in portuguese to english:

1 ACCEPTED SOLUTION
Community Support

Hi @Hrenechen ,

Please update the formula of calculated column [Goal Positivation (Und)] as below and check if it can return the expected result...

``````Goal Positivation (Und) :=
VAR POSITIVwACTIVES =
SUMX ( dGoal, dGoal[Positivation (%)] * [Active Base] )
VAR CodException =
MAX ( RcaException[ID.RCA Exception] )
RETURN
IF (
POSITIVwATIVOS = 0
|| ISBLANK ( POSITIVwATIVOS )
|| CONTAINS ( dMeta, [ID.RCA], CodException ),
BLANK (),
DIVIDE ( POSITIVwACTIVES, [Active Base], BLANK () )
) * [Active Base]``````

If the above one can't help you, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. Also please provide the related info if there is any relationship among these tables. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
New Member

Rena, thank you!
Be bless!

Community Support

Hi @Hrenechen ,

Please update the formula of calculated column [Goal Positivation (Und)] as below and check if it can return the expected result...

``````Goal Positivation (Und) :=
VAR POSITIVwACTIVES =
SUMX ( dGoal, dGoal[Positivation (%)] * [Active Base] )
VAR CodException =
MAX ( RcaException[ID.RCA Exception] )
RETURN
IF (
POSITIVwATIVOS = 0
|| ISBLANK ( POSITIVwATIVOS )
|| CONTAINS ( dMeta, [ID.RCA], CodException ),
BLANK (),
DIVIDE ( POSITIVwACTIVES, [Active Base], BLANK () )
) * [Active Base]``````

If the above one can't help you, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. Also please provide the related info if there is any relationship among these tables. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.