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

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.

Reply
Anonymous
Not applicable

Strange behavior for a mesure and table

Hi all,

 

I want to put you in situation. For a project, I'm changing the excel with power pivot to power bi. I'm trying to use the same parameters, measures, tables, datasources etc... In the way to do I'm suffering an error with a measure. the error is that:

error.PNG

 

The thing is in the excel file I'm not sure if is a measure or calculate column. I tested with both cases and the error is the same that I paste before.

 

power pivot.PNG

 

The measure that I'm using is:

 

Color Rentabilidad Flex = if([TotalBrutoRentabilidad]>0;CALCULATE ( VALUES ( 'TramosRentabilidad'[sDescripcion] );FILTER ( 'TramosRentabilidad'; ([Rentabilidad]*100) >= 'TramosRentabilidad'[fValMinTramo]  && ([Rentabilidad]*100) < 'TramosRentabilidad'[fValMaxTramo] )))

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous 

You may try to use aggregated function like MIN,MAX...to instead of VALUES.For example:

Color Rentabilidad Flex =
IF (
    [TotalBrutoRentabilidad] > 0,
    CALCULATE (
        MAX ( 'TramosRentabilidad'[sDescripcion] ),
        FILTER (
            'TramosRentabilidad',
            ( [Rentabilidad] * 100 ) >= 'TramosRentabilidad'[fValMinTramo]
                && ( [Rentabilidad] * 100 ) < 'TramosRentabilidad'[fValMaxTramo]
        )
    )
)

Regards,

Community Support Team _ Cherie Chen
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
Anonymous
Not applicable

I think , the wrong here is the "Values" parameter the description of the "Values" parameter is "Returns a one-column table that contains the distinct values from the specified table or column. In other words, duplicate values are removed and only unique values are returned." 

 

Someones knows any other command instead of "Values"?

Hi @Anonymous 

You may try to use aggregated function like MIN,MAX...to instead of VALUES.For example:

Color Rentabilidad Flex =
IF (
    [TotalBrutoRentabilidad] > 0,
    CALCULATE (
        MAX ( 'TramosRentabilidad'[sDescripcion] ),
        FILTER (
            'TramosRentabilidad',
            ( [Rentabilidad] * 100 ) >= 'TramosRentabilidad'[fValMinTramo]
                && ( [Rentabilidad] * 100 ) < 'TramosRentabilidad'[fValMaxTramo]
        )
    )
)

Regards,

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.