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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Anonymous
Not applicable

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

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!

Anonymous
Not applicable

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.