Forum Discussion
Naveen29
Helper II
4 years agoDAX help
Need help on the below scenerio: How to write a DAX? actual table: Category Value A 10 B 20 C 30 Out put expecting in the dashboard: Category Value % A A/C 3...
parry2k
Super User
4 years agoNaveen29 smpa01 measure will work but here is another version of it
% =
DIVIDE (
CALCULATE ( SUM ('Table'[Value] ), KEEPFILTERS ( 'Table'[Category] <> "C" ) ),
CALCULATE ( SUM ('Table'[Value] ),'Table'[Category] = "C" )
)
✨ Follow us on LinkedIn and to our YouTube channel
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) 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.
- Naveen294 years ago
Helper II
Thanks parry2k - This formula is working fine. However , there is another problem over here. My data is like below. When we have break on the data ,this DAX is not working as expected.
Ex:
Value Group 1\Category Name A 1 B 3 C 4 Group2 \Category Name X 2 Y 3 Z 6 Value % Group 1 Total 100% A A/C 25% B B/C 75% Group2 Total 100% X X/Z 33% Y Y/Z 50% Global Total Measure = (A+B+X+Y)/(C+Z) 90%