Forum Discussion

Kornholio1313's avatar
Kornholio1313
Frequent Visitor
2 years ago

Create two different fields from single table with one date

Hello all!

 

I need to use one table, with one Created Date and output two different fields from that. Basically, a user can choose one date timeframe and the output would be called "Branded". Then the user can choose another, different timeframe, from the same table and the output is called "UnBranded".

 

Should look like this

 

 

Where "Branded" is based off of one date selected and "UnBranded" is based off a different date selected. Both are using the same Created Date Field.

 

5 Replies

  • Kornholio1313 , For this the slicer needs to be on independent date table

     

    //Date1 is independent Date table
    Branded  =
    var _max = maxx(allselected(Date1),Date1[Date])
    var _min = minx(allselected(Date1),Date1[Date])
    return
    calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

     

     

     

    //Date1 is independent Date table
    Not Branded  =
    var _max = maxx(allselected(Date1),Date1[Date])
    var _min = minx(allselected(Date1),Date1[Date])
    return
    calculate( sum(Table[Value]), filter('Table', 'Table'[Date] < _min && 'Table'[Date] > _max))

     

    Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

    • Kornholio1313's avatar
      Kornholio1313
      Frequent Visitor

      ThanksAmit!, So, I created two tables with the same data. I want to show two calendar filters, one for the chosen "Branded" between dates and the other filter with the "UnBranded" between dates. Can i show this in one table format like this then?

       

      • amitchandak's avatar
        amitchandak
        Super User

        Kornholio1313 ,

        If you need branded and unbranded as rows, You need create measures for

        UnBranded records, UnBranded Engaged , UnBranded diff

         

        Branded records, Branded Engaged , Branded diff

         

        As suggested above and then use calculation group to create the desired output.

         

        Remember, you need a column, but calculated column can not take slicer value, so you have to go measure way

         

        Check the option, where I have split the Calculation group using a custom column

         

        Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

    • Kornholio1313's avatar
      Kornholio1313
      Frequent Visitor

      HI amitchandak ! I did create those fields, but how do i create the BRANDED and UNBRANDED to show on the same table chart, one for each line? Like this???