Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Dynamic column name in columns from a measure

HI ,

 

I have a table whose purpose is to show (1) quantity in process (2) Shelf  each week  (week 1, wk 2 - upto Wk 17) for certain category of product (Gauge_Width). The dates for each week changes as we move forward.

 

 

Each week is defined by quantity in different steel production stages.

The current columns are measures. For i.e. Wk 1 in process is at "Coating " and "OP" stations.

Wk1_In Process = CALCULATE(DIVIDE(SUM(StationInventories[Weight]),2000),FILTER(StationInventories,StationInventories[Wk 1 Station]="Coating"||StationInventories[Wk 1 Station]="OP")), and 
Wk1 Shelf = [Current Wk Shelf]-[Wk1_In Process]
Current Wk Shelf measure and all other measures are defines in similiar manner
 
This is the data view:
 
 
 
Now , the issue which  I am facing is that the column name do not have date of the week (start of the week date for current purposes). I somehow need to show that Wk 1 is 8th Feb, Wk 2 15th Feb. As you can see, in the first snapshot I have tried to use a ,card visualization and show it by filtering respectively (17 cards for each week), But this will fail as I drag the matrix towards Wk 17. 
 
Is it possible to have dates included in colum name for both the values for each week. At present, I have used Matrix visual with Col empty.
 
Greatly appreciate any help on this!
 
Thanks.

5 Replies

  • Does it have to be measures or could it be calculated columns that you generate in Power Query during dataset refresh? There it is easy to rename columns. In DAX, not so much.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sorry for the extremely late response! I tried as you suggested, but could not figure out how to have these as calulated columns in power Query .  All I could achieve was to have catgegorization column , i.e. wk 1, wk 2 under query. But I dont think I can add a column which will pick-up quantity corresponding to wk 1, wk 2. (What these two functions are achieving : 

      Wk1_In Process = CALCULATE(DIVIDE(SUM(StationInventories[Weight]),2000),FILTER(StationInventories,StationInventories[Wk 1 Station]="Coating"||StationInventories[Wk 1 Station]="OP")), and 
      Wk1 Shelf = [Current Wk Shelf]-[Wk1_In Process). 
      Please share, if there is a way to get this.
      Much Appreciated!
      Thanks.
    • Anonymous's avatar
      Anonymous
      Not applicable

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    If you don't mind, please share me a dummy .pbix file for test. Please just contain necessary data in your file and remove sensitive information. Then I can do some test.😉

     

     

    Best Regards,

    Icey

    • Anonymous's avatar
      Anonymous
      Not applicable

       I am not able to share a file here.