Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filtered data not showing correctly in Bar graph

Hi Experts

 

See attached PBIX file with sample data. What i am trying to accomplish is when the user selects from the table product ID 72201092 the bar graph filters to reflect the element of the 156 that relates to product 72201092. which is does correct. 

 

The issue is when you select product code 72201092, and then select Significant Trend the bar graph goes to zero, and when you select No Trend you have values in the bar graph. 

 

What i am expect is for the bar grpah to plot the element of the data that relate to Significant trend in the bar chart as the product code has significant trend as shown in the above table and  no values for No Trend. 

 

https://www.dropbox.com/s/jj62h2vxtepm5yd/Sample__Test%281%29.pbix?dl=0

 

  • Hi Anonymous ,

     

    When you select the product, the month filter will apply to the p-value, so it will be judged as No Trend as always.

     

     

    Community Support Team _ DongLi
    If this post helps, then please consider Accept it as the solution to help the other members find it more

3 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    When you select the product, the month filter will apply to the p-value, so it will be judged as No Trend as always.

     

     

    Community Support Team _ DongLi
    If this post helps, then please consider Accept it as the solution to help the other members find it more

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi Dong_li

       

      I would expect the bar graph to filter when i select the product to show the element of the data that relates to No Trend and Signifcant trend , which it does, however the problem lie with the dis connect table. When you Select either No and or Significant Trend the values are wrong they do not correspond to the selection made.

       

      i have added measure (test it) - believe there is a relationship issue somewhere between the measure and the [Month_Date] taken from PMS_Financials Table...

      NO TREND

       

      _Mnth_NoTrend = CALCULATE (
          IF (
              ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
              BLANK (),
              COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID])
          ),
          FILTER (
              ALLSELECTED ( PMS_PARTS[Product] ),
              CALCULATE('_Measures'[p-value]) > 0.05
          )
      ) + 0

      SIGNIFCANT TREND

      Mnth_SignificantTrend = CALCULATE (
          IF (
              ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
              BLANK (),
              COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID])
          ),
          FILTER (
              ALLSELECTED ( PMS_PARTS[Product] ),
              CALCULATE('_Measures'[p-value]) <= 0.05
          )
      ) + 0

      And then added the following measure to the Bar Graph

      _Mnth = VAR _ProductTrends = SELECTEDVALUE(_TrendsTable[Trends])
      Return
      
      SWITCH(TRUE(),
          _ProductTrends = "No Trend", [_Mnth_NoTrend],
          _ProductTrends = "Significant Trend", [Mnth_SignificantTrend],
      [PMSComplaintsMN]
      ) + 0

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Community Team

      i just did the following Steps. I selected Product ID72201092 went to View on tool bar selected Performance Analyzer > Start Recording > Selected the Products Complaints Totals with Trend Direct Table 

       

      Then Select copy Visual, this gave me the DAX code which allows me to cross filter. Here is the code. Surely the answer must lie here, on how we can count the data poiints that are significant and those that have No Trend.

      DEFINE =
        VAR __DS0FilterTable = TREATAS({"Y"}, 'PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND])
      
        VAR __ValueFilterDM0 = FILTER(
            KEEPFILTERS(
              SUMMARIZECOLUMNS(
                'PMS_PARTS'[Product],
                __DS0FilterTable,
                "p_value", '_Measures'[p-value],
                "v__trend", '_Measures'[__trend],
                "ArrowY", 'URLImages'[ArrowY],
                "Significance_Y", '_Measures'[Significance Y],
                "TAU", 'PMS_FINANCIAL_PDS'[TAU],
                "NoTrend_Significants", '_TrendsTable'[NoTrend_Significants]
              )
            ),
            [NoTrend_Significants] > 0
          )
      
        VAR __DS0Core = 
          SUMMARIZECOLUMNS(
            'PMS_PARTS'[Product],
            __DS0FilterTable,
            __ValueFilterDM0,
            "p_value", '_Measures'[p-value],
            "v__trend", '_Measures'[__trend],
            "ArrowY", 'URLImages'[ArrowY],
            "Significance_Y", '_Measures'[Significance Y],
            "TAU", 'PMS_FINANCIAL_PDS'[TAU],
            "NoTrend_Significants", '_TrendsTable'[NoTrend_Significants]
          )
      
      EVALUATE
        GROUPBY(
          __DS0Core,
          "MinNoTrend_Significants", MINX(CURRENTGROUP(), [NoTrend_Significants]),
          "MaxNoTrend_Significants", MAXX(CURRENTGROUP(), [NoTrend_Significants])
        )
      
      EVALUATE
        TOPN(501, __DS0Core, 'PMS_PARTS'[Product], 1)
      
      ORDER BY
        'PMS_PARTS'[Product]