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
Jeanxyz
Post Prodigy
Post Prodigy

values() filter doesn't pass to the table

I have been fighting with a Dax formula for hours. I wonder if someone can help. 

 

I have an IssueSprint table as below. Each Jira issue is assigned to a sprint (10 work days). Each Sprint has a Start_Date and End_Date, if an issue is not solved during the period, it's passed onto next sprint. Some issues receive story points, which is an workload indicator. 

 

I have 58 story points in Demo Sprint 17, and I expect in each work day 10% issues are solved, so the remaining story points by end of day 1 is 90%*58, by day2, 80%*58 ....

 

I try to create a measure (guideline)  to duplicate this calculation logic, but it doesn't work. sample file: https://www.dropbox.com/s/0rxpfy4gfnxcucm/Jira%20Demo.pbix?dl=0

jira demo.PNG

 

guideline(M) =
Var select_date=min(max('Calendar'[Date]),today())
var amt=
sumx(
values(IssueSprints),
calculate(max(IssueSprints[story_points])*
(1- Divide(
if(select_date<calculate(max(IssueSprints[Start_Date])),1,
//if select date<start date, completion rate=1,
if (select_date>calculate(max(IssueSprints[End_Date])),1,
//if select date>end date, completion rate=1,
calculate(sum(Calendar[Workday_BE]),Calendar[Date]<=select_date,Calendar[Date]>=calculate(max(IssueSprints[Start_Date])))
//select date falls betweeen start_date & end_date, calculate no of workdays from start_date to select_date
)),
10))))
return
amt
 
@amitchandak , @parry2k , @otravers, @Greg_Deckler 
1 ACCEPTED SOLUTION
Jeanxyz
Post Prodigy
Post Prodigy

I think I figured it out. 

There was a bug in the divide () part, also I created a dim_issuesprints table for use in the values(). 

 

guideline =
Var select_date=min(max('Calendar'[Date]),today())
var amt=
sumx(
values(dim_IssueSprints),
calculate(max(IssueSprints[story_points])* (1-
calculate(
divide(
if(select_date<max(IssueSprints[Start_Date]),10,
if (select_date>max(IssueSprints[End_Date]),10,
calculate(sum(Calendar[Workday_BE]),Calendar[Date]<=select_date,Calendar[Date]>=max(IssueSprints[Start_Date])))),
10)))))
var start_date=minx(values(dim_issuesprints),calculate(max(IssueSprints[Start_Date])))
return
amt

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Jeanxyz,

I'm glad to hear you find the reason and sharing the formula here, I think they may help other who faced the similar issue.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Jeanxyz
Post Prodigy
Post Prodigy

I think I figured it out. 

There was a bug in the divide () part, also I created a dim_issuesprints table for use in the values(). 

 

guideline =
Var select_date=min(max('Calendar'[Date]),today())
var amt=
sumx(
values(dim_IssueSprints),
calculate(max(IssueSprints[story_points])* (1-
calculate(
divide(
if(select_date<max(IssueSprints[Start_Date]),10,
if (select_date>max(IssueSprints[End_Date]),10,
calculate(sum(Calendar[Workday_BE]),Calendar[Date]<=select_date,Calendar[Date]>=max(IssueSprints[Start_Date])))),
10)))))
var start_date=minx(values(dim_issuesprints),calculate(max(IssueSprints[Start_Date])))
return
amt

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.