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
Niiru1
Helper V
Helper V

Subtract if statement from a measure (working days)

Is there a way to replace 2.5 in Measure 5.0 with this IF statement [Rules]?

 

Measure 5.0 =
VAR _Month = CALCULATE(COUNT(DimDate[Days in Month]),FILTER(DimDate,'DimDate'[WorkingDays] <>BLANK()))
VAR _lastday=
COUNTROWS(
FILTER(DimDate,'DimDate'[WorkingDays] <>BLANK()))-2.5
RETURN
IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday )

 

 

Rules =
VAR searcind = SEARCH("Industr",'Query1'[GRADE_NAME],1,BLANK())
VAR searcnotind = FIND("Industr",'Query1'[GRADE_NAME],1,-1)
VAR duration510 = IF(searcind<>BLANK(),IF(AND('Query1'[Total Years - Employment] >=0,'Query1'[Total Years - Employment] <5),CALCULATE(23.5/12),BLANK()),BLANK())
VAR notindnot10 = IF(AND('Query1'[Total Years - Employment] <10,searcnotind),CALCULATE(25/12))
VAR ind5 = IF(AND('Query1'[Total Years - Employment] >= 5,searcind),CALCULATE(25.5/12),duration510)
VAR notind10 = IF(AND('Query1'[Total Years - Employment] >= 10,searcnotind),CALCULATE(30/12),notindnot10)
RETURN
IF(ind5<>BLANK(),ind5,notind10)

 

 

 

https://www.dropbox.com/s/xjagu2e89p5fe4a/Sample4.pbix?dl=0

1 REPLY 1
vivran22
Community Champion
Community Champion

Hello @Niiru1 

 

What exactly you want to replace it with?

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

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.

Top Solution Authors