Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Hrenechen
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


Hrenechen_0-1685460549917.png

 

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

 

Hrenechen_2-1685461353301.png

 

 

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
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.

View solution in original post

2 REPLIES 2
Hrenechen
New Member

Rena, thank you!
Your sollution work fine, and my problem is solved, I will make sure to read your links about the best pratices for the comunity!
Be bless!

v-yiruan-msft
Community Support
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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.