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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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