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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
df123445
Helper II
Helper II

how to calculate value from column and measure

I have a a measure that calculates the number of rows for a specific content:

 

CountC = CALCULATE(COUNT('Clicked'[CID]),GROUPBY('Clicked','Clicked'[CONTENT]))
 
CIDCONTENT
111ABC
222ABC
333ABC
111DEF
 
On a separate table I have some benchmark values:
CONTENTBENCHMARK
ABC4
DEF3

 

I would like to put both values in a visual table and use them both to calculate if the benchmark has been reached (and possibly showing a up or down arrow). 

CONTENTCountCBENCHMARK%
ABC34-25%
DEF13-66%
    

The problem is that I don't know how to get a measure and a column to interact.

 

Is there a way to do that? 

 

Many thanks in advance 

1 ACCEPTED SOLUTION

Hi @df123445 ,

 

I created the following measure. Please check.

Benchmark% = var _sum=SUM('Benchmark'[Benchmark])
return DIVIDE([CountC]-_sum,_sum)

vstephenmsft_1-1698140325129.png

The same relationship setup as you.

vstephenmsft_2-1698140347523.png

 

Best Regards,

Stephen Tao

 

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

6 REPLIES 6
df123445
Helper II
Helper II

Thanks, but when I create
 
%Benchmark= Count/ sum(Benchmark)-1
 
and add it to the table I don't get just a value for each type of content but the same value repeated for each 
row. doesn't  sum(Benchmark) just add all benchmarks together?
 
 
 
 

hi @df123445 
Are u looking for total sum of benchmark?

Uzi2019_0-1697539967966.png

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi @df123445 
Can you share the screenshot??

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

sure, the data is a bit more complex than I said:

 

 

df123445_2-1697544267185.png

 

 - table open has a measure that counts the number of customer_ids for each content_name

- table list is connected to Benchmarks via Linea 

 

OPEN:

Customer idContent
123CONTENT1
456CONTENT1
789CONTENT1
123CONTENT2

 

List

CONTENTLINEA
CONTENT1Linea1
CONTENT2Linea1
CONTENT3Linea2

 

Benchmarks

LINEABenchmark
Linea15
Linea22

 

I hope it makes sense.

 

I woud like to show for each linea a table with a list of content and a sum of customers that opened it, next to it I would like to show the benchmark.

 

Many thanks again

Hi @df123445 ,

 

I created the following measure. Please check.

Benchmark% = var _sum=SUM('Benchmark'[Benchmark])
return DIVIDE([CountC]-_sum,_sum)

vstephenmsft_1-1698140325129.png

The same relationship setup as you.

vstephenmsft_2-1698140347523.png

 

Best Regards,

Stephen Tao

 

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

Uzi2019
Super User
Super User

Hi @df123445 
Please follow the steps:
Create relationship between 2 tables

Uzi2019_0-1697537822207.png


then create measure under CID table
Count_content= Count('Table'[Content])

Take table and add all the values you want in the table

Uzi2019_1-1697537972852.png

 

Create measure for your % field
%Benchmark= Count/ sum(Benchmark)-1

Uzi2019_3-1697538330315.png

 

If my post helps you then give kudos and accept it as a solution!
Thanks

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.