Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Negative value to display as a specific group in treemap

Hi , 

 

I have tree map chart to show the value with 2 types. But we will have negative values in 'Prov' type.  What I'm thinking is to keep 'Dest' and separate 'Prov' to two parts , 'Prov+' and 'Prov-' , and use abs() for those negative value to show in 'Prov-'. 

 

Would you please help me on how to do it? 

 

Group : Type (Column)

Detail : Line (Column)

Values: measure (Measure)

jackwu_0-1611189268243.png

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @parry2k , 

 

Thank you for your solution. 

 

I've tried your way in my case. But seems it's same error as before when I created a column to put in dynamic value. 

jackwu_0-1611639531590.png

In this case, I will not be insist on the treemap. I'm trying the stacked bar chart to meet our requirement. 

jackwu_1-1611639751009.png

Thank you all for your kindly help on this case. 

View solution in original post

11 REPLIES 11
parry2k
Super User
Super User

@Anonymous although the solution I provided does work as it worked in the sample pbix file, for circular dependency there is something else going on. Anyhow,  you are moving on but you need to understand why this dependency error is showing up, check this post here.

 

Good luck!

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous here is a better example, Tau has two records with -ve and +ve, and the sum of both records is+ve and it will show correctly under Prov + bucket.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k , 

 

Thank you for your solution. 

 

I've tried your way in my case. But seems it's same error as before when I created a column to put in dynamic value. 

jackwu_0-1611639531590.png

In this case, I will not be insist on the treemap. I'm trying the stacked bar chart to meet our requirement. 

jackwu_1-1611639751009.png

Thank you all for your kindly help on this case. 

parry2k
Super User
Super User

@Anonymous The solution provided by @PhilipTreacy will work assuming that you want to check negative at the row level (record level) but assuming if a Group + Detail contains some negative and positive records and the sum of it turn out to be positive then this solution will not work. Although I'm not sure if this is the requirement in your case. Anyhow kudos to @PhilipTreacy for the solution.

 

Here is a solution that doesn't check negative and positive at the row level but check the sum of group + detail combination and then put it in the respective bucket. 

 

Just throwing out there if this turns out to be the requirement, if not then the solution provided by @PhilipTreacy is the way to go.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

PhilipTreacy
Super User
Super User

Hi @Anonymous 

Please download my sample PBIX file with data and visual

Without your data I had to make some up, so I used this table

src.png

 

and transformed it with Power Query to this

mod-src.png

 

and then created this Treemap

 

tmap.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi @PhilipTreacy , 

 

Thank you for your solution. Based on your data structure , that's the way to go. 

For may case, maybe I can give you an example to explain. 

If the calculation will be depends on date. If we select 2020, then Prov of 'Gamma' is negative, but if select 2021 or both selected, the Prov of 'Gamma' is positive. 

jackwu_0-1611638586106.png

 

V-pazhen-msft
Community Support
Community Support

@Anonymous 
Circular dependency is a relationship error, the problem is the measure [P&L Impact FM vs M].

Avoiding circular dependency errors in DAX - SQLBI.

 

Paul

 

 

V-pazhen-msft
Community Support
Community Support

@Anonymous 
I guess you cannot put measure in the group field, create a column should work.


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @V-pazhen-msft , 

 

I created the column, but there is an error - A circular dependency was detected: Depreciation[Column], Depreciation[Commercial Line Group], Depreciation[Column]. it's because the calculation is not based on row, it's acutally based on selected , it's dynamic. 

jackwu_0-1611550993921.png

 

amitchandak
Super User
Super User

@Anonymous , If you need at line level then column else you need dynamic segmentation

If([value] <0, "Prov", [Dest])

 

In this case, you need to use the measure to create dynamic segmentation, refer if these can help

https://www.youtube.com/watch?v=CuczXPj0N-k

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Anonymous
Not applicable

Hi @amitchandak , 

 

Thanks for your quick support. 

The expected type value should be Dest , Prov+ and Prov-. 

And even we use a measure to dynamicly separate the positive and negative value in Prov type , we can't apply this measure in group of Tree map chart. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.