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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Syndicate_Admin
Administrator
Administrator

Doubt with SWITCH Metric

Hello everyone, good afternoon, my name is Leandro and I am blocked with a measure.


I have a measure called --> Balance = (Cobros_Facturados + Cobros_Proyectados) - (Pagos_Facturados + Pagos_Proyectados)

The Collections and Invoiced Payments come from the same table, and the Projected ones come from another.

If I display all measurements separately on a multi-value card, the Balance measure shows me the correct value.

If I show all the measures in a table, using a measure (called e.g. "Values") with a SWITCH function, the Balance measure shows me as a result the difference between Collections and Invoiced Payments, and does not consider for the calculation the Projected Collections and Payments.

The formula of the measure "Values" is:

Values =

VAR CurrentItem = SELECTEDVALUE(Grupo_FF[Concept])

RETURN SWITCH( TRUE(),

CurrentItem = "Charges", [Cobros_Facturados],

CurrentItem = "Projected Charges", [Cobros_Proyectados],

CurrentItem = "Payments", -[Pagos_Facturados],

CurrentItem = "Projected Payments", -[Pagos_Proyectados],

CurrentItem = "Balance", [Balance])

Attached screenshot with the values shown on the card and the values shown in the table.

Métricas.PNG

Thank you! Best regards.

Leandro

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.