Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

need help: error in stacked bar chart representation using calculated column as legend

I have a PBI report where i am calculating the ops that got closed or going to get closed within 0-7 days from created date (Quick Closure within 0-7 days from creation date to close date), when i showing the data in table view, it shows correct data.

measure used to calculate Quick closure

Logic Quick Closure 0-7 =
SWITCH( TRUE(),
    DATEDIFF('pipeline'[CreatedOn], 'pipeline'[CloseDate], DAY) <= 7, "0-7 days",
    BLANK()
)

I am using same column measure as legend (Logic Quick Closure 0-7) in stacked bar chart, sales person name in y-axis, count of opportunity (distinct) in x axis, which shows wroung information.

error 1: the count of opportunity shows incorrect count

Amilcar has 10 ops in count but in stacked bar it shows 216

attached snapshot: error closure.png

error 2: when i am filtering data (stacked bar chart) which are going to close in currect quarter (Apr-Jun), then count of opportunity goes down but some of the names gets blank data in table view.

Jeremy has 31 in stacked bar chart, but it shows blank in table view

attached snapshot: error closure 1.png

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous ,
    Thank you for sharing more details.I would be happy to assist you!

    I tried to recreate it on my local with the sample data.
    Please try using below calculated column :
    QuickClosureGroup =
    VAR DaysDiff = DATEDIFF('pipeline'[CreatedOn], 'pipeline'[CloseDate], DAY)
    RETURN IF(DaysDiff <= 7 && NOT(ISBLANK('pipeline'[CloseDate])), "0-7 days", BLANK())

    Attaching the file for your reference.

    If this asnwer mees your requirement,consider accepting it as solution.

    Regards,
    Pallavi.


9 Replies

  • Hello Anonymous 

     

    Create calculated column and then try

     

    Quick Closure 0-7 (Column) =
    VAR DaysDiff = DATEDIFF('pipeline'[CreatedOn], 'pipeline'[CloseDate], DAY)
    RETURN
    IF(DaysDiff <= 7, "0-7 days", BLANK())

     

    Thanks

    Pankaj

  • Hi Anonymous 

     

    Error 1 – Is the bar chart correctly filtered to show only the 0–7 days category? Or is it also including blank values?

    Error 2 – This might still be connected to Error 1. Your table is filtered to display only 0–7 days, while the bar chart shows all values. Jeremy J has blank entries but none in the 0–7 days range.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      danextian, the data table has blank value, as we have calculated column that we are using as legend filter, which is 

      Quick closure

      Logic Quick Closure 0-7 =
      SWITCHTRUE(),
          DATEDIFF('pipeline'[CreatedOn]'pipeline'[CloseDate]DAY) <= 7"0-7 days",
          BLANK()
      )
       
      i have filtered out blank from the bar chart, so that only 0-7 days ops can be shown, also i made a another filter where i am analysing top 10 sale person name with heighest count of ops
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,
        Thank you for sharing more details.I would be happy to assist you!

        I tried to recreate it on my local with the sample data.
        Please try using below calculated column :
        QuickClosureGroup =
        VAR DaysDiff = DATEDIFF('pipeline'[CreatedOn], 'pipeline'[CloseDate], DAY)
        RETURN IF(DaysDiff <= 7 && NOT(ISBLANK('pipeline'[CloseDate])), "0-7 days", BLANK())

        Attaching the file for your reference.

        If this asnwer mees your requirement,consider accepting it as solution.

        Regards,
        Pallavi.


  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,
    I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,
    Could you please confirm if the issue has been resolvedon youe end? If a solution has been found, it would be greatly appreciated if you could share your insights with the community. This would be helpful for other members who may encounter similar issues.
    Thank you for your understanding and assistance.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Anonymous , issue solved

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,
        Glad that your query got resolved.If so,consider accepting it as solution.

        Thanks & Regards,
        Pallavi.