Forum Discussion

PBIViz_2024's avatar
PBIViz_2024
Icon for Advocate I rankAdvocate I
2 years ago
Solved

How would the Dax logic need be written to replicate the same result as the built-in average line

Hi, I have line chart with Daily actual value for last 30day and I have used a average line as below to show the average of actual value which is a constant line for the period.It looks like below(r...
  • amitchandak's avatar
    2 years ago

    PBIViz_2024 , If you have Avg measure , you can have measure like below and use that using FX option in constant line

     

    Avg = calculate([Measure], removefilters(DateTable))

     

    Avg = calculate([Measure], allselected())

     

    or Avg of Month or day on a Sum measure

     

    Avg Month = calculate(Averagex(Vales(Date[Month Year]), [Measure]) , allselected())

     

    Avg Day= calculate(Averagex(Vales(Date[Date]), [Measure]) , allselected())