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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
michellem0771
Helper I
Helper I

Help with DAX Measure

Hello,

 

I have two tables, Applications and Closing Reports. They have two inactive relationships between the two tables. 

I need to calculate the turnaround time between the response date and the start date and created a measure, however, the measure isn't quite correct and I'm not sure how to optimize it to get the correct result.

 

The measure is this:

michellem0771_0-1717593624752.png

The measure is calculating correctly at 48 days when shown in a table graph, though the total shows 14:

michellem0771_1-1717593716233.png

However, once I bring the turnaround time (the measure) into a bar graph, the results are incorrect and show the 14 days:

michellem0771_2-1717593803921.png

Unfortunately, I cannot attach the .pbix file, so I'm hoping someone can help with this issue.

 

Thanks in advance!

 

 

 

2 ACCEPTED SOLUTIONS
jgeddes
Super User
Super User

As far as I can see the issue here is your measure works in the body of the table because there is the context of job name / IDs that allow the userrelationship context to work. 
The total row and the bar graph lack that context so the measure is returning the "wrong" value.
My suggestion would be to create a calculated column in either of your tables that returns the date difference for each row context. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

@michellem0771 @jgeddes 

thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below


I am glad to help you.

According to your description you are using the created measure in table and it is displaying fine, but not in card!

This is a very common problem, because it has to do with the computational environment in which the measure is placed (when you put the measure directly into the card, it actually shows the value of the total)

like this:

vjtianmsft_0-1717667799994.png

 

When you use a measure or calculate column, the card will always show the total value.

(power bi will show the aggregated value)

Here are my suggestions

1. add a slicer (the external filter way)

vjtianmsft_1-1717667836334.png

2. Add filters to the dax code (add internal filters)

vjtianmsft_2-1717667846746.png

vjtianmsft_3-1717667853018.png

 

measure is affected by filters in the current visual and filters in the dax code as well as external filters (slicers)

while calculate column is affected by the row context (current row)

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@michellem0771 @jgeddes 

thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below


I am glad to help you.

According to your description you are using the created measure in table and it is displaying fine, but not in card!

This is a very common problem, because it has to do with the computational environment in which the measure is placed (when you put the measure directly into the card, it actually shows the value of the total)

like this:

vjtianmsft_0-1717667799994.png

 

When you use a measure or calculate column, the card will always show the total value.

(power bi will show the aggregated value)

Here are my suggestions

1. add a slicer (the external filter way)

vjtianmsft_1-1717667836334.png

2. Add filters to the dax code (add internal filters)

vjtianmsft_2-1717667846746.png

vjtianmsft_3-1717667853018.png

 

measure is affected by filters in the current visual and filters in the dax code as well as external filters (slicers)

while calculate column is affected by the row context (current row)

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jgeddes
Super User
Super User

As far as I can see the issue here is your measure works in the body of the table because there is the context of job name / IDs that allow the userrelationship context to work. 
The total row and the bar graph lack that context so the measure is returning the "wrong" value.
My suggestion would be to create a calculated column in either of your tables that returns the date difference for each row context. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.