Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

Dynamic column title with dates

I have the following table

How can I create a new column or in some other way so that instead of DATE I put the date I have in the repor filter?

Thank you.

16 Replies

  • Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
    If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Please show the expected outcome based on the sample data you provided.

    If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • On the one hand, I have the table with the sections of my matrix:

    idnumberscope
    1Orders in the month to DATENational
    2Orders in the month to DATEExport
    3Orders in the month to DATETOTAL
    4Orders received on DATENational

    Then, for each line in that table, I have a measure that calculated the amount.

    Once I have all the measurements, I make the matrix:

    Measure "Apartado_ordinatto 3" is as follows:

    Apartado_Ordinatto 3 = SWITCH([apartado_ped_selec3],
    1,[Ped_En_El_Mes_Hasta_NACIONAL],
    2,[Ped_En_El_Mes_Hasta_EXPORT],
    3,[Ped_En_El_Mes_Hasta],
    4,[Ped_Recibidos_el_NACIONAL],

    It is a switch that binds the id to its respective measure to create the array. The problem is that in the matrix, in columns I put the column name of the table but as you can see, it is a title that should change according to the filter that is put in the date reclassification.

    Also, if the title is "Orders in the month to DATE" it should be changed to Orders in the month to 13/10/2023 (this is an example.)

    • lbendlin's avatar
      lbendlin
      Super User

      Please provide sample data that fully covers your issue.
      Please show the expected outcome based on the sample data you provided.

  • Sorry, I've already added the sample data before, I don't know what else data you need...

    It would only take some measure to test it, but it can be anyone.

    Ped_En_El_Mes_Hasta_NACIONAL = 1

    In the end, it doesn't matter what the number is... All I want is the title that appears.

    • lbendlin's avatar
      lbendlin
      Super User

      You don't want to do that. Instead, add the date to the columns of the matrix and then expand the columns.

       

  • The problem is that the date isn't a column in the table, it's a date selected from the slicer. In the first comment there is a screenshot where you can see it.

    • lbendlin's avatar
      lbendlin
      Super User

      I don't think that is a problem. The date field will show at the top of the column hierarchy and be controlled by the slicer.

  • It won't let me put a measure as a column. Besides, I don't want a new hierarchy on top, I want a single header but one that is dynamic.

    • lbendlin's avatar
      lbendlin
      Super User

      One way to do that is to create a disconnected table with all possible permutations and base the slicer and measure off that 

  • I would already have the table, what I don't understand is "all possible permutations...". Could you give me an example?

    • lbendlin's avatar
      lbendlin
      Super User

      A cross join of all dates and all clients.  With the dash in between, I guess.

  • Yes, I've already proven that. I've created a custom column as you say, dates + client

    But I can't find a way to create the personified column and grab the selected dates from the segmentation....

    • lbendlin's avatar
      lbendlin
      Super User

      you need to base your measure off that table.

  • I'm sorry, I don't understand.

    I have a separate table with the titles, so the next thing would be to create a measure but that captures the value of the segmentation, is that right?

    If so, as I mentioned earlier, it doesn't work because it doesn't allow you to put that measurement as a column in an array.

  • I still can't find a solution... I don't know if you can help me with a small example of what you are talking about.

    Thank you.