cancel
Showing results for
Did you mean:
Frequent Visitor

## What's wrong in my measure? HELP!

I'm triying to do this measure

metas rotacion = var area = VALUES('prebel area_nomina'[abr])
0,3 ;
IF(NOT(ISERROR(area));
SWITCH(area;
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date]))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))
)
;0)
)
)
)

But Power BI shows me an error "mDXsCRIPT(Model) (21 ,12) Calculation error in measure 'preber metas[metas rotacion]: A table of multiple values was supplied where a single value was expected"

What's wrong in my measure? Help me please

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft

@smath,

This issue is caused by that you use VALUES()  in your DAX. VALUES() funtion returns a one-column table that contains the distinct values from the specified table or column.  Change your DAX to the following and check if you get expected result.

```metas rotacion = var area = FIRSTNONBLANK('prebel area_nomina'[abr];1)
0,3 ;
IF(NOT(ISERROR(area));
SWITCH(area;
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date]))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))
)
;0)
)
)
)```

Regards,
Lydia

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

@smath,

This issue is caused by that you use VALUES()  in your DAX. VALUES() funtion returns a one-column table that contains the distinct values from the specified table or column.  Change your DAX to the following and check if you get expected result.

```metas rotacion = var area = FIRSTNONBLANK('prebel area_nomina'[abr];1)
0,3 ;
IF(NOT(ISERROR(area));
SWITCH(area;
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date]))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))));
FILTER('prebel metas'; 'prebel metas'[Fecha_Inicio]<=CALCULATE(MAX('prebel calendario'[db_date]))); FILTER('prebel metas'; 'prebel metas'[Fecha_Fin]>= CALCULATE(MIN('prebel calendario'[db_date])))
)
;0)
)
)
)```

Regards,
Lydia

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

Hi Lydia, effectively this is a solution to my problem.

Thank u very much, was a super solutior.

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Power Platform October Community Highlights

Check out the top community contributors across all of the communities

#### Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors