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
Anonymous
Not applicable

Calculated column if a task repeats

Hi again folks.

I'm trying to create a calculated column in this table: 

KeySprint
D2C-176Sprint 08
D2C-176Sprint 09
D2C-391Sprint 10
D2C-391Sprint 11
D2C-545Sprint 11
D2C-545Sprint 13
D2C-635Sprint 10
D2C-635Sprint 12
D2C-635Sprint 13

 

that results in this

KeySprintRept
D2C-176Sprint 08 
D2C-176Sprint 091
D2C-391Sprint 10 
D2C-391Sprint 111
D2C-545Sprint 11 
D2C-545Sprint 131
D2C-635Sprint 10 
D2C-635Sprint 121
D2C-635Sprint 131

 

Can anyone help me?

 

TY guys

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can try something like this:


Rept = 
VAR varKey = table[Key]  

VAR varSprint = table[Sprint]

VAR varSprintMin = 

    CALCULATE ( MIN ( table[Sprint] ), table[Key] = varKey )

RETURN

IF ( varSprint = varSprintMin, BLANK (), 1 )

 

varKey saves current key as variable

varSprint saves current sprint as variable

varSprintMin calculates minimum of sprints for all rows with same key as current key

return value: if current sprint is minimum of sprints with same key, returns BLANK, else 1

 

 

-- editted for formating reasons

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

Give this a try.

Rept = 
VAR _Key = 'YourTable'[Key]
VAR _Sprint = 'YourTable'[Sprint]
VAR _MinSprint =
    CALCULATE ( MIN ( 'YourTable'[Sprint] ), ALL ( 'YourTable' ), 'YourTable'[Key] = _Key )
RETURN
    IF ( _Sprint = _MinSprint, BLANK (), 1 )
Anonymous
Not applicable

You can try something like this:


Rept = 
VAR varKey = table[Key]  

VAR varSprint = table[Sprint]

VAR varSprintMin = 

    CALCULATE ( MIN ( table[Sprint] ), table[Key] = varKey )

RETURN

IF ( varSprint = varSprintMin, BLANK (), 1 )

 

varKey saves current key as variable

varSprint saves current sprint as variable

varSprintMin calculates minimum of sprints for all rows with same key as current key

return value: if current sprint is minimum of sprints with same key, returns BLANK, else 1

 

 

-- editted for formating reasons

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