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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors