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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vjnvinod
Impactful Individual
Impactful Individual

Switch with or Measure

Dear all,

 

Below is the measure i am using.

Currently, can you help me to tweak this measure by introducing Or condition within the switch statement?

CorrectedMeasureDonut =
VAR __raw = [Current HC] + [Preboarding Pipeline] + [Additional approved Exp Hire] + [Additional Approved Graduate] - [Exit Pipeline]
VAR X =
SELECTEDVALUE ( GCCvNGCC[GCC/NGCC/Expats_P])
VAR NEP =
VALUES ( GCCvNGCC[GCC/NGCC/Expats_P] )
VAR ExPVal =
SWITCH (
X,
"Expat",[Expat_P Value],
"Expat",[Expat_M Value],
"Expat",[Expat_S Value],
"Expat",[Expat_SM Value],
"Expat",[Expat_S/A Value],
"Expat",[Expat_ED Value],
0
)
VAR ExP =
IF ( "Expat" IN NEP, ExPVal, 0 )
VAR NaPVal =
SWITCH (
X,
"GCC National", [National_P Value],
"GCC National", [National_M Value],
"GCC National", [National_S Value],
"GCC National", [National_SM Value],
"GCC National", [National_S/A Value],
"GCC National", [National_ED Value],
0
)
VAR NaP =
IF ( "GCC National" IN NEP, NaPVal, 0 )
VAR GDPVal =
SWITCH (
X,
"GDS", [GDS_P Value],
"GDS", [GDS_M Value],
"GDS", [GDS_S Value],
"GDS", [GDS_SM Value],
"GDS", [GDS_S/A Value],
"GDS", [GDS_ED Value],
0
)
VAR GDP =
IF ( "GDS" IN NEP, GDPVal, 0 )
VAR TR = __raw + ExP + NaP+GDP
RETURN
TR
 
 
 
1 REPLY 1
amitchandak
Super User
Super User

@vjnvinod , for same values you are retuning different measures

 

Left is all same

SWITCH (
X,
"GDS", [GDS_P Value],
"GDS", [GDS_M Value],
"GDS", [GDS_S Value],
"GDS", [GDS_SM Value],
"GDS", [GDS_S/A Value],
"GDS", [GDS_ED Value],
0
)

 

 

Please refer to my video on switch and see if that can help: https://www.youtube.com/watch?v=gelJWktlR80

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.