cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

Calculation, single chart based on 3 measures

I have this issue, I am having a Reveneue KPI thats comprised of 3 components(each is a separate measure). I want my bar chart to show the revenue as total in first layer of hierarchy. and want to display each component revenue at subsequent node of hierarchy.
like node 0 -> total revenue
node 1-> component 1  revenue

node 2-> component 2  revenue

node 3-> component 3  revenue

Please guide how can we do it?

Sana

1 ACCEPTED SOLUTION
New Member

Thanks everyone, we acheived the solution using Switch function and added component type table as selector for selecting one component type or the other.

3 REPLIES 3
Employee

@sana_sagheer wrote:

I have this issue, I am having a Reveneue KPI thats comprised of 3 components(each is a separate measure). I want my bar chart to show the revenue as total in first layer of hierarchy. and want to display each component revenue at subsequent node of hierarchy.
like node 0 -> total revenue
node 1-> component 1  revenue

node 2-> component 2  revenue

node 3-> component 3  revenue

Please guide how can we do it?

Sana

@sana_sagheer

Maybe you can create a tricky measure to detect the hierarchy level and then show different measures accordingly. Just replace 1,2,3,4 with the measures in your case. See more in the attached pbix file.

```Measure =
SWITCH (
TRUE (),
HASONEVALUE ( yourTable[node0] ) && NOT ( ISFILTERED ( yourTable[node1] ) )
&& NOT ( ISFILTERED ( yourTable[node2] ) )
&& NOT ( ISFILTERED ( yourTable[node3] ) ), 1,  // in hierachy level 1
HASONEVALUE ( yourTable[node0] ) && HASONEVALUE ( yourTable[node1] )
&& NOT ( ISFILTERED ( yourTable[node2] ) )
&& NOT ( ISFILTERED ( yourTable[node3] ) ), 2,  // in hierarchy level 2
HASONEVALUE ( yourTable[node0] ) && HASONEVALUE ( yourTable[node1] )
&& HASONEVALUE ( yourTable[node2] )
&& NOT ( ISFILTERED ( yourTable[node3] ) ), 3,  // in hierarchy level 3
4 //in hierarcy level 4
)```

Super User

Hmm, that's an interesting problem. I am not aware of a way to build a hierarchy with measures so interested in seeing if someone has an interesting solution to this. You could definitely do it in two different visualizations.

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
New Member

Thanks everyone, we acheived the solution using Switch function and added component type table as selector for selecting one component type or the other.

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors