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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
anuj_a
Frequent Visitor

measure to distribute specific row share among the other row values as per share percentage

I have a data something like below table, and the need is to distribute the blank tag cost among the other tag according to their related share of not blank value. Example..

 

tagcost
aaa100
bbb10
ccc40
ddd50
(blank)80
bbb60
ccc30
ddd20
aaa40
(blank)500
(blank)100

 

Expected calculation

 

for aaa the share will be "140/(100+20+30+50+60+30+20+40)" = 40% of 680

for bbb the share will be  "70/(100+20+30+50+60+30+20+40)" = 20% of 680

for ccc the share will be "70/(100+20+30+50+60+30+20+40)" = 20% of 680

for ddd the share will be "70/(100+20+30+50+60+30+20+40)" = 20% of 680

 

expected solution

 

tagcost%sharetotal Share
aaa14040% of 680272
bbb7020% of 680136
ccc7020% of 680136
ddd7020% of 680136

 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @anuj_a ,

According to your description, here’s my solution.

  1. %share = DIVIDE(SUM([cost]),SUMX(FILTER(ALL('Table'),NOT(ISBLANK([tag]))),[cost]))
  2.  total share = SUMX(FILTER(ALL('Table'),ISBLANK([tag])),[cost])*[%share]
  3.  Unselect blank

vkalyjmsft_0-1636452879013.jpeg

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
anuj_a
Frequent Visitor

thanks @v-yanjiang-msft  and @Greg_Deckler - your solutions worked with my POC data, however my prod data with more filters and columns has some problems with this solution. 
May be I will share more relavant dummy data other time on separate question. for this query I am good. thanks for your assistance.  

v-yanjiang-msft
Community Support
Community Support

Hi @anuj_a ,

According to your description, here’s my solution.

  1. %share = DIVIDE(SUM([cost]),SUMX(FILTER(ALL('Table'),NOT(ISBLANK([tag]))),[cost]))
  2.  total share = SUMX(FILTER(ALL('Table'),ISBLANK([tag])),[cost])*[%share]
  3.  Unselect blank

vkalyjmsft_0-1636452879013.jpeg

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

.

Greg_Deckler
Community Champion
Community Champion

@anuj_a Seems like:

Measure = 
  VAR __Total = SUMX(FILTER(ALL('Table'),[tag]<>BLANK()),[cost])
  VAR __BlankTotal = SUMX(FILTER(ALL('Table'),[tag]=BLANK()),[cost])
  VAR __TagTotal = SUM('Table'[cost])
  VAR __Percent = DIVIDE(__TagTotal,__Total,0)
RETURN
  __TagTotal + __Percent * __BlankTotal


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.