Forum Discussion

ruzty87's avatar
ruzty87
New Member
2 years ago
Solved

Measure returns different dates (one on a visual card, another one in table)

Hi everyone

 

Problem: I have created a slicer that has starting dates in 2017 and ending dates in July 2024. I selected 01/01/17 til 31/01/24. If i create a measure 

Datum selektiert = calculate(MAX('Cube'[Leistungszeitraum von]),allselected('Cube'))
 
it returns the value 31/01/24 (just like I want it to) on a simple card BUT not if I create a column with the function: 
Spalte = [Datum selektiert]
 
there it will return 17/07/24 (so the max of the initial range) instead of my selected 31/01/24 date.
 
Since i would like to calculate other columns off of the [Datum selektiert], this must be correct / according to what is selected on the slicer.

Why does it return two different values with the exact same function?!
 
 
Thanks
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ruzty87 

    The results of the measure depend heavily on the filter context. Measures are made for dynamic calculations that change based on user actions such as filtering or slicing. Measures are calculations that are performed dynamically based on data in table columns. Measure values are not stored in tables but are calculated each time they need to be visualized or calculated. So it returns the maximum date within the slicer's selection range.

     

    Unlike measures, calculated columns are not dynamic, they are only calculated once when the table is first loaded or refreshed; this happens during the query. Therefore, the calculated column provides a static value that does not change based on the filter context and returns the maximum date in the entire data set.

     

    To get consistent results across visuals, consider using the measure directly in the visual without converting it to a calculated column. For more information on the difference between calculated columns and measures check out this link: Understanding Measures vs Calculated Columns in Power BI (gorilla.bi).

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ruzty87 

    The results of the measure depend heavily on the filter context. Measures are made for dynamic calculations that change based on user actions such as filtering or slicing. Measures are calculations that are performed dynamically based on data in table columns. Measure values are not stored in tables but are calculated each time they need to be visualized or calculated. So it returns the maximum date within the slicer's selection range.

     

    Unlike measures, calculated columns are not dynamic, they are only calculated once when the table is first loaded or refreshed; this happens during the query. Therefore, the calculated column provides a static value that does not change based on the filter context and returns the maximum date in the entire data set.

     

    To get consistent results across visuals, consider using the measure directly in the visual without converting it to a calculated column. For more information on the difference between calculated columns and measures check out this link: Understanding Measures vs Calculated Columns in Power BI (gorilla.bi).

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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