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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ERAHUMO
Frequent Visitor

Ratio between count of individual rows and aggregated column

I have data 1 in following format:

Headervalue
A1
A1
A1
A1
A1
A1
A1
A1
B1
B1
B1
B1
B1
B1
B1
B1
B1
C1
C1
C1
C1
C1
C1
C1
C1
C1
D1
D1
D1
D1
D1
D1
D1
D1


and data 2 in following format

HeaderCount
A10
B20
C20
D10


I am expecting to create a table visual in power bi which will give me following output

 

headerdata1_valuedata2_countfinal
A8100.8
B9200.45
C9200.8
D8100.45


Can you help me to write a DAX measure to achieve final column

 

1 REPLY 1
Dangar332
Super User
Super User

Hi, @ERAHUMO 
@ERAHUMO 
try below
make two measure
juast adjust your table and column name

 

a1= COUNTX('data1','data1'[value])

and

countfinal = DIVIDE([a1],MAX('data2'[Count]))

 

 

plot table visual and put column and above measure  you get like below

Dangar332_0-1699457429552.png

OR 

you can make a new table 
just adjust your table and column name

Table 3 = 

ADDCOLUMNS(ALL('data2'[Header]),
     "data1",CALCULATE(COUNT('data1'[value])),
     "count",CALCULATE(MAX('data2'[Count])),
     "countfinal",
      DIVIDE(
        CALCULATE(
           COUNT('data1'[value])
        ),
        CALCULATE(
          MAX('data2'[Count])
        )
    )
)

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.