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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MissBI_21
Helper II
Helper II

How to add calculated measure to an existing column

Hi, I was wondering if anyone could help.

 

I currently have a table like the one shown below where the column 'Metric' contains Days and Revenue.

 

MissBI_21_0-1652349867574.png


At the moment, I have a calculated measure called Day Rate which is displayed as a seperate column:

Day Rate = DIVIDE(
Calculate(SUM('Pentest Days Delivered (3)'[Value]), FILTER( 'Pentest Days Delivered (3)','Pentest Days Delivered (3)'[Metric]="Revenue")),
Calculate(SUM('Pentest Days Delivered (3)'[Value]), FILTER( 'Pentest Days Delivered (3)','Pentest Days Delivered (3)'[Metric]="Days"))
)
 
Is there anyway to add the 'Day Rate' data in the 'Metric' column as I want to create a matrix to show Days and Day Rate like below (but replace revenue with day rate):
 
MissBI_21_1-1652350034722.png

Thank you in advance!

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

Hi  @MissBI_21 ,

I created some data:

You can follow the order of the columns in this table to create:

vyangliumsft_1-1652678642993.png

Here are the steps you can follow:

1. Create calculated table.

SUM_table =
var _summtable=
SUMMARIZE('Table',
[Date],
[Division],
"Metrice","Day Rate",
"Value",
(
SUMX(FILTER(ALL('Table'),'Table'[Metric]="Revenue"&&MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))),[Value])
/
SUMX(FILTER(ALL('Table'),'Table'[Metric]="Days"&&MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))),[Value]))/2
)
return
UNION(
    'Table',_summtable)

2. Result:

vyangliumsft_2-1652678642998.png

Best Regards,

Liu Yang

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

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @MissBI_21 ,

I created some data:

You can follow the order of the columns in this table to create:

vyangliumsft_1-1652678642993.png

Here are the steps you can follow:

1. Create calculated table.

SUM_table =
var _summtable=
SUMMARIZE('Table',
[Date],
[Division],
"Metrice","Day Rate",
"Value",
(
SUMX(FILTER(ALL('Table'),'Table'[Metric]="Revenue"&&MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))),[Value])
/
SUMX(FILTER(ALL('Table'),'Table'[Metric]="Days"&&MONTH('Table'[Date])=MONTH(EARLIER('Table'[Date]))),[Value]))/2
)
return
UNION(
    'Table',_summtable)

2. Result:

vyangliumsft_2-1652678642998.png

Best Regards,

Liu Yang

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

Thank you for this.

 

Although I had to change my data to a table, this did work.

Thank you for this.

 

Although I had to change my data to a table, this did work.

amitchandak
Super User
Super User

@MissBI_21 , Not you can not add measure to column.

 

You need to create a meausre

 

Or try dynamic segmentation

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

 

 

THanks for the above but how can I show days and day rate in a matrix?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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