Forum Discussion

brightcitrus's avatar
brightcitrus
Frequent Visitor
6 years ago

Remove unnecessary date points? DAX measures using ALLSELECTED

Hello PBI User Group,

 

I am facing a little challenge and I would greatly appreciate your help.

 

I created two measures (average and standard deviation) to create the two measures I really need to graph, which are the control limit and the warning limit. However, when I plot my limits, all my dates appear and my date slicer is no longer filtering the graph. I suppose this is because I am using the ALLSELECTED filter? I tried changing it but this is the only formula that is giving the right values for my limits. Please find below the formulas and the screenshots.

 

Average = calculate(AVERAGEX('Month-Year',Complaints[Disposables Complaint Rate]),ALLSELECTED(Complaints))
 
Rate STD = calculate(STDEVx.p(filter('Month-Year','Month-Year'[Mo-Yr]='Month-Year'[Mo-Yr]),Complaints[Disposables Complaint Rate]),ALLSELECTED(Complaints))
 
 
As you can see, my limits are plotted fine but I have all these unnecessary date points. How can I get rid of the unnecessary dates in the x axis please and have the date slicer filter the line chart at the same time?
 
Thank you very much for your help.

6 Replies

  • JarroVGIT's avatar
    JarroVGIT
    Resident Rockstar

    Please share your datamodel, is Month-Year a designated datetable?

    • JarroVGIT's avatar
      JarroVGIT
      Resident Rockstar

      Are the flat lines the measures you provided or other measures?

      • brightcitrus's avatar
        brightcitrus
        Frequent Visitor

        The flat lines are the limits, red is control limit and orange is the warning limit. They use the average and the standard deviation formulas I posted. Control limit = average + 3*standard deviation.

         

        Also, Month-Year is the data table. How can I share my data model? What information do you need exactly?

         

        Thank you for your help.

  • v-diye-msft's avatar
    v-diye-msft
    Community Support

    Hi brightcitrus 

     

    Do you mean you'd like to remove the unnecessary axis values? please make sure the "Show items with no data" is not enabled in the axis filed.

    also, you can use the filter pane, to filter the relative valuable dates of your axis. 

     

    You can modify the slicer into the same periods with filter panel as well. 

     

    • brightcitrus's avatar
      brightcitrus
      Frequent Visitor

      Hello v-diye-msft 

       

      Thank you very much for your suggestions. I am aware of these filtering features, however the output is still not the desired output.

       

      When I unselect the unnecessary date points, I am still left with a graph that is not responsive to the date filter since I am using ALLSELECTED. The graph does not "zoom out" or "zoom in" on the dates selected. Also, show items with no data is unchecked and the date points still show.

       

      I think that there is somthing wrong with my formula. Could you please help me fix it?

       

      Thank you very much for your help.

      • v-diye-msft's avatar
        v-diye-msft
        Community Support

        Hi brightcitrus 

         

        Would you mind kindly sharing your dummy pbix that I can check it furtherly? thanks!