cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## How to use "If" in "New Measure" to check the another field?

Hello All,

I am trying to use the "New Measure" to hardcode the "Target" number. However, I am not sure how to check the data column in order to return the correct "Target".

My formula is like this but it won't work.

If ( Data[Type] = "A" , 100 , If ( Data[Type] = "B" = 200 , If ( Data[Type] = "C" = 300 , 0 )))

3 REPLIES 3
Helper III

Hi All,

I try to use max on for each Data[Type] and it do return the result I want. However, why the "Total" is not the sum by all those figure? Now, the "Total" is 300 .......

Super User

@KH_Mike , Try one of the two ways.

Sumx(Data,
Switch ( True(),
Data[Type] = "A" , 100 ,
Data[Type] = "B" = 200 ,
Data[Type] = "C" = 300 , 0 ))

Sumx(Values(Max(Data[Type])), calculate(
Switch ( True(),
Max(Data[Type]) = "A" , 100 ,
Max(Data[Type])= "B" = 200 ,
Max(Data[Type])= "C" = 300 , 0 ) ) )

Helper III

I tried to use your method but it will come out few thousand for A and few thousand for B. Is it because I have many serval A and B records?

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors