Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to filter columns with different date columns in the same barchart?

I have a barchart with 5 bars, each bar represents values in some columns, I need 4 of that bars to be filtered with an specific date column but the fifth bar is needed to be filtered with another date column, all of this in the same barchart.

 

How can I do this?

 

pd: for the fifth bar I have tried to do a metric with a calculate but I don't really know how to indicate that It must take only the second date column and ingnore the previus filters applied to the barchart.

 

Thanks.

  • Hello Joan,

     

    sometimes you just don't need DAX to achieve your solution :-)

     

    What have I done:

     

    1. I went to the PowerQuery Editor and unpivot your X1 - X5 columns
    2. Then I added a conditional "relevant date"column. IF X5 then Date_B else Date_A
    3. I was able to achieve your desired result

    Here you have an example file. Please add your data as a text next time so that we can copy that fast to Power BI Desktop. (Screenshots are not that helpful ;-) )

     

    Please like&mark this reply if I was able to help you.

     

    Joan I wish you a nice day

     

    BR,

    Josef

4 Replies

  • Hello Joan_Smith,

     

    may I ask you to provide us with some sample data or a sample report?

     

    BR,

    Josef

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello JosefPrakljacic,

       

      Thanks, this is an example of the data and a photo of the barchart where the fifth bar needs to be filtrated by other date different from the date that is in axis x.

       

       

       

      As I said, I was trying to use a new measure using a calculate but I got lost when indicating to the formula that the expression has to be calculated with the second column of date.

       

      Thanks for the help.

       

      • JosefPrakljacic's avatar
        JosefPrakljacic
        Icon for Solution Sage rankSolution Sage

        Hello Joan,

         

        sometimes you just don't need DAX to achieve your solution :-)

         

        What have I done:

         

        1. I went to the PowerQuery Editor and unpivot your X1 - X5 columns
        2. Then I added a conditional "relevant date"column. IF X5 then Date_B else Date_A
        3. I was able to achieve your desired result

        Here you have an example file. Please add your data as a text next time so that we can copy that fast to Power BI Desktop. (Screenshots are not that helpful ;-) )

         

        Please like&mark this reply if I was able to help you.

         

        Joan I wish you a nice day

         

        BR,

        Josef