Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is there anyway I could get B instead of A, A is the normal setup for the table, matrix visuals
Solved! Go to Solution.
You could turn your measures into a dimension using the pattern discussed here:
View Solution in Original Post
Once this is done, you can add the measure name to the rows instead of the columns...
For example, I created an inline static table with my measure names in it like this:
Metrics = DATATABLE("Measure",STRING,{{"Revenue"},{"Costs"},{"Gross Profit"}})
I already have separate measures set up for my revenue, costs, and gross profit. I just added another measure I called Val that is basically a switch based on which measure name is filtered by the current row (when used in a matrix for example):
Val = SWITCH(LASTNONBLANK('Metrics'[Measure],1),"Revenue", [Revenue],"Costs",[Cost],"Gross Profit",[Gross Profit])
And then I created a matrix with state and Metrics[Measure] on my rows, date on my columns, and Val as the value:
Yes, but you will need to specify the aggregation like so:
Val = SWITCH(LASTNONBLANK('Metrics'[Measure],1),"Revenue", SUM([Revenue FIELD not Measure]),"Costs",SUM([Cost FIELD not Measure]),"Gross Profit",SUM([Gross Profit FIELD not Measure]))
I did find that I was getting rows with blank states and values as you can see by my last screenshot. This is because the Metrics table has no relationships to my other tables, and my DAX measure wasn't handling that. So I changed it to the following, basically making sure that Val only returns something if it's used along with the Metrics.Measure field in a visual AND it will result in at least one of the measures in my list having a value (I chose revenue because in my example I can't have any of the other measures without their being revenue for that sale. You may need to check if any of your measures have a value in your case).
Val = IF(NOT(ISBLANK([Revenue])) && HASONEVALUE(Metrics[Measure]),
SWITCH(LASTNONBLANK('Metrics'[Measure],1)
, "Revenue", FORMAT([Revenue],"Currency")
, "Costs", FORMAT([Cost],"Currency")
, "Gross Profit", FORMAT([Gross Profit],"Currency")
, "Markup", FORMAT([Markup Pct],"Percent")
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |