Displaying measure names as dimensions (in rows)

Hello,
I’m trying to display a list of measure names as dimension names in rows. So I created new table in DAX using the UNION and ROW functions. Here is a snippet :
Indicateurs =
UNION(
ROW( “CAUSES” , “OTHER”, “VALUES” , [Other HM] ),
ROW( “CAUSES” , “CHARGE_AVG”, “VALUES” , [Charge avg.] )
)

The problem is that the measures are not filtered when added to the report (VALUES column).

I would like to have a table like this :
CAUSES VALUES
OTHER 999
CHARGE_AVG 888

Note that the values under CAUSES do not exist in my Fact table. This is a new type of dimension that the client would like to analyse their data by. I thought by creating a table in DAX, I could set the row values (CAUSES) and add the necessary measure but unfortunetely that does not work.

The measures filter correctly when added directly to the report, example with a Card graphic.

Any ideas ?

Thanks heaps

Hi @Fiona. If you need to show a value even if there are no rows, try adding zero to your measures (e.g., [Total Sales] = SUM( Sales[Line Total] ) + 0). To display measures in a “table”, try using a matrix instead of a table and showing the values on rows.
Greg

2 Likes

Hi Fiona,

I don’t know if the solution by Greg helped you out already. If not, this might also help:

Hi @Greg
Thank for you the infor, did not know that

Unfortunately for my request, the client would like to show the measure names (or dimension grouping) in an histogram.
Thanks

Hi Rens
Thank you for your reply.

I think I may be close to a solution (it’s midnight already here so I’ll have to confirmer tomorrow if all the data is filtered out well lol)

Well I did the following and the measures seem to filter correctly :

  1. Created a Data Table with the static names of my “measure dimensions”
    (TU - DATATABLE) TABLE =
    DATATABLE(
    “Measure ID” , INTEGER ,
    “Measure Name” , STRING ,
    {
    { 1,“AUTERS_TEMPS_ATT”} ,
    { 2,“CHARGE_MOY”} ,
    { 3,“DISTANCE_MOY”},
    { 4,“TPS_CHGT”} ,
    { 5,“TPS_DECHGT”} ,
    { 6,“TPS_ATT_VIDE”} ,
    { 7,“TPS_ATT_CHARGE”} ,
    { 8,“TPS_VITESSE_MOY”}
    }
    )

  2. I then created another measure to pull in the correct measures based on the dimension names above :
    Dynamic Measure =
    VAR nomMesure = Min (’(TU - DATATABLE) TABLE’[Measure Name])

    Return
    SWITCH( TRUE() ,
    nomMesure = “AUTERS_TEMPS_ATT” , [Autres HM] ,
    nomMesure = “ME” , [% ME] ,
    nomMesure = “CHARGE_MOY” , [Charge moy.] ,
    nomMesure = “DISTANCE_MOY” , [Distance moy] ,
    nomMesure = “TPS_CHGT” , [Tps chgt] ,
    nomMesure = “TPS_DECHGT” , [Tps dechgt] ,
    nomMesure = “TPS_ATT_VIDE” , [Tps d’att à vide] ,
    nomMesure = “TPS_ATT_CHARGE” , [Tps d’att à chargé],
    nomMesure = “TPS_VITESSE_MOY” , [Vitesse Moy.]
    )

  1. Then in my graph, I added the column “MeasureName” from the Data Table (step 1), and the “Dynamic Measure” (step 2).

I’ll confirm if al the data is filtered well with this setup and before setting my question to solution.

But if anyone has a better solution, please let me know

Thanks