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
kldefens
Frequent Visitor

How to create a measure with an if condition

hi guys,

I want to create a measure that multiplies column "C&OCalaculate" with 100 if Column "VullingtotaalPerc" = "100 %".

 

the measure should look something like this: if Column "VullingtotaalPerc" = "100%" then multiply Column "C&OCaluculate" with 100 + 

if Column "VullingtotaalPerc" = "40%" then multiply Column "C&OCaluculate" with 40 and so on.

 

I've tried to use the If-statement but I can't choose any columns because they are not a measure (??)


thnx guys!!

 

 

A4E90C66-29FB-483C-AB3D-7198F5B6E61D.png

2 REPLIES 2
Mahesh0016
Super User
Super User

Mahesh0016_0-1670844243958.png

Hello @kldefens ,
I hope Above solution is helpful for you!

Hi Mahesh,
This worked! Thank you so much, but now I've have another problem.
I can't figure out how to get the grand total.

 

I've created a measure called "IF_cond C&O-calculated". 
Example: This measure will multiply column "C&O-Calculated%" with 100 if the column "VullingTotaalPerc" is 100 %.
The measure is working fine but it won't show a grand total of percentage. 

Down below is the measure:

IF_cond C&O-calculated =
VAR valling = SELECTEDVALUE(MKA[VullingTotaalPerc])

RETURN
SWITCH(TRUE(),
valling= "100 %", MKA[C&O-Calculated%] * 1,
valling= "90 %", MKA[C&O-Calculated%] * 0.9,
valling= "80 %", MKA[C&O-Calculated%] * 0.8,
valling= "70 %", MKA[C&O-Calculated%] * 0.7,
valling= "60 %", MKA[C&O-Calculated%] * 0.6,
valling= "50 %", MKA[C&O-Calculated%] * 0.5,
valling= "40 %", MKA[C&O-Calculated%] * 0.4,
valling= "30 %", MKA[C&O-Calculated%] * 0.3,
valling= "20 %", MKA[C&O-Calculated%] * 0.2,
valling= "10 %", MKA[C&O-Calculated%] * 0.1

kldefens_0-1670870992144.png

 

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.