Forum Discussion

Florek's avatar
Florek
Frequent Visitor
2 years ago
Solved

No total value for measure

Hi

 

I have measure, calculated outcome is correct but there is no total value. why?

 

 

sales_PY = CALCULATE(
       [_Sales],
       FILTER(ALL(Total_data),
           'Total_data'[year_week] = SELECTEDVALUE('Total_data'[year_week]) - 100
           && Total_data[Region] IN VALUES(Total_data[Region])
           && Total_data[Bascet] IN VALUES(Total_data[Bascet])
           && Total_data[Company] IN VALUES(Total_data[Company])
   ))

 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from ryan_mayu , please allow me to provide another insight:

    Hi, Florek 

    In response to your question, I offer two approaches:
     

    1.The first is to use the HASONEFILTER () function as the basis for judgment, and then output the SUMX () function as the aggregate.

    Here are the related links, I hope you will be helpful:

    Dealing with Measure Totals - Microsoft Fabric Community
    Measure Totals, The Final Word - Microsoft Fabric Community
     

    2.The second is to convert the measures into groups of calculations and then modify the aggregation:

    You can try the following code as a calculated column:

    Then modify the way it aggregates: 

     

    Best Regards,

    Leroy Lu

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

  • Florek 

     could you pls provde some sample data? i think myabe that's because you restricted the row value.

     SELECTEDVALUE('Total_data'[year_week])

     

  • Florek's avatar
    Florek
    Frequent Visitor

    Hi Anonymous 

    excludnig 'selectedvalue' function for testing brings total back. But how I should include this condition to calculation different way?

    I can't upload any file here ;/