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
gregers1972
Frequent Visitor

DAX calculation for factor correction

Good Morning
I have a small issue with some data, where they need to be rescaled as follows. Lets say we have a pressure value p_i (i = 1 - n) and I need to scaled this as : p_i_scaled = (p_i / 32768) * 500, which is pretty straigtforward.

The data are organised row-wise:

Parameters         Date                                Value
A                         2022-09-15 13:22:02       345.3

B                          2022-09-15 13:22:07       255.5

C...                       2022-09-15 13:22:12        37.5

 

How can I select parameter A's corresponding value for each time point and scale this accordingly.

Any help is greatly appreciated, thanks

Gregers

1 ACCEPTED SOLUTION

@gregers1972 

You can 

SUMX ( 'Table', 500 * 'Table'[VarValue] / 32768 )

View solution in original post

10 REPLIES 10
gregers1972
Frequent Visitor

I hope you mean on the data, they are as shown here for 3 series with 5 parameters and values.

VarNameTimeStringVarValue
A03/05/2022 10:00:031395
B03/05/2022 10:00:036470
C03/05/2022 10:00:0325
D03/05/2022 10:00:03216
E03/05/2022 10:00:0315815
A03/05/2022 10:00:081393
B03/05/2022 10:00:086630
C03/05/2022 10:00:080
D03/05/2022 10:00:080
E03/05/2022 10:00:0815809
A03/05/2022 10:00:131389
B03/05/2022 10:00:136730
C03/05/2022 10:00:130
D03/05/2022 10:00:130
E03/05/2022 10:00:1315806

The first datatable was not so easy to read but here again with 3 series and 5 parameters and values.

gregers1972_0-1663227257400.png

 

 

Hi @gregers1972 
I was talking about the expected results. Please illustrate with an example calculation

For the first row with p_i = 345.3 the calculation is:

p_i_corrected = (345.3 / 32768) * 500 = 5.27

@gregers1972 

Not sure if I correctly understand but you may create a new calculated column 

500 * 'Table'[VarValue] / 32768

Thanks and thought the actual calculation would be like this. The trick is that there are several values in multiple rows for the same parameter e.g. A for different timepoints, which must be selected and corrected individually.

@gregers1972 
I'm still trying to guess. Please provide the full picture so that I can understand the requirement. How many tables are invloved in this? What are the relationships?

It is only a single table.  In the data table shown earlier, there is an "A" row in "VarName" with multiple entries with different "timestring" and each "VarValue" (row wise) I need to correct them differently than e.g. "B"

 

Select_VarValue = select(VarValue), from Table(VarName(A)) #Maybe need to loop over all A's

 

Select_VarValue = 500 * 'Table'[Select_VarValue] / 32768

@gregers1972 

You can 

SUMX ( 'Table', 500 * 'Table'[VarValue] / 32768 )

tamerj1
Super User
Super User

Hi @gregers1972 
Please provide an illustrative example

Helpful resources

Announcements
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.