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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Naveen29
Helper II
Helper II

DAX help

Need help on the below scenerio: How to write a DAX?

actual table:

 

CategoryValue
A10
B20
C30

 

Out put expecting in the dashboard:

 

CategoryValue%
AA/C33%
BB/C67%
TotalMeasure = (A+B)/C100%
1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Naveen29  try this measure

Measure =
VAR _sum =
    DIVIDE (
        CALCULATE ( SUM ( t3[Value] ), FILTER ( t3, t3[Category] <> "C" ) ),
        CALCULATE ( SUM ( t3[Value] ), FILTER ( ALL ( t3 ), t3[Category] = "C" ) )
    )
RETURN
    _sum
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@Naveen29 the solution was based on your original question, now what you are sharing is totally different from than the original requirement. 

 

The question, what decided to use C or Z what is the logic here? Always provide full details. The solution is based on the requirement.

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

 



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

@Naveen29 @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 YouTube.gif 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.



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.

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 
A1
B3
C4
Group2 \Category Name 
X2
Y3
Z6

 

 Value%
Group 1Total100%
AA/C25%
BB/C75%
Group2Total100%
XX/Z33%
YY/Z50%
Global TotalMeasure = (A+B+X+Y)/(C+Z)90%
smpa01
Super User
Super User

@Naveen29  try this measure

Measure =
VAR _sum =
    DIVIDE (
        CALCULATE ( SUM ( t3[Value] ), FILTER ( t3, t3[Category] <> "C" ) ),
        CALCULATE ( SUM ( t3[Value] ), FILTER ( ALL ( t3 ), t3[Category] = "C" ) )
    )
RETURN
    _sum
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors