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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
krishak77
Helper I
Helper I

Get DAX formula in Measure

Hello All,

 

Can anybody please provide me DAX formula to apply only in Measure and not in Add Column for the below requirement?

 

Hello Team,

 

I need DAX formula to get as below excel calculation

 

On D2 cell given as =C2

On D3 cell given as =D2+C3 and it should continue till last row

On E2 cell given as =IF(AND(D2<0.9,D3>=0.9),A2+(A3-A2)*(0.9-D2)/(D3-D2),0) and it should continue till last row.

 

 

Row LabelsCount of SotatCount of Sotat2FR_PerFill Rate 90
0896573.96%73.96%0
110358.54%82.49%0
28607.09%89.59%2.076497696
36515.37%94.96%0
41291.06%96.02%0
5770.64%96.66%0
6620.51%97.17%0
71150.95%98.12%0
8400.33%98.45%0
9340.28%98.73%0
10460.38%99.11%0
11110.09%99.20%0
12140.12%99.32%0
13220.18%99.50%0
14230.19%99.69%0
15110.09%99.78%0
2030.02%99.80%0
21130.11%99.91%0
2940.03%99.94%0
3010.01%99.95%0
3310.01%99.96%0
4130.02%99.98%0
5220.02%100.00%0
     
     
     
     
     
     
     
     
     
     
     

 

Thank you in advance

 

Regards,

AK

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @krishak77 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Create a calculated column as below to get it:

Fill Rate 90 = 
VAR _nextlabel =
    CALCULATE (
        MIN ( 'Table'[Row Labels] ),
        FILTER ( 'Table', 'Table'[Row Labels] > EARLIER ( 'Table'[Row Labels] ) )
    )
VAR _nextfrper =
    CALCULATE (
        MAX ( 'Table'[FR_Per] ),
        FILTER ( 'Table', 'Table'[Row Labels] = _nextlabel )
    )
RETURN
    IF (
        [FR_Per] < 0.9
            && _nextfrper >= 0.9,
        'Table'[Row Labels] + ( _nextlabel - 'Table'[Row Labels] ) * ( 0.9 - 'Table'[FR_Per] ) / ( _nextfrper - 'Table'[FR_Per] ),
        0
    )

vyiruanmsft_0-1696930769766.png

Best Regards

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

measures are working with aggregated data. Your calculations clearly work on row level so they need calculated columns or (more likely) Power Query code to work.

Hi @lbendlin ,

 

Thanks for your response.

 

The about table is pivot table from large data of Excel, and I need this to calculate in Power Bi only for showing above table by using Matrix chart in Power Bi.

 

So could you please help to provide Dax formula to applied in measure?

 

Thank you in advance.

Anonymous
Not applicable

Hi @krishak77 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Create a calculated column as below to get it:

Fill Rate 90 = 
VAR _nextlabel =
    CALCULATE (
        MIN ( 'Table'[Row Labels] ),
        FILTER ( 'Table', 'Table'[Row Labels] > EARLIER ( 'Table'[Row Labels] ) )
    )
VAR _nextfrper =
    CALCULATE (
        MAX ( 'Table'[FR_Per] ),
        FILTER ( 'Table', 'Table'[Row Labels] = _nextlabel )
    )
RETURN
    IF (
        [FR_Per] < 0.9
            && _nextfrper >= 0.9,
        'Table'[Row Labels] + ( _nextlabel - 'Table'[Row Labels] ) * ( 0.9 - 'Table'[FR_Per] ) / ( _nextfrper - 'Table'[FR_Per] ),
        0
    )

vyiruanmsft_0-1696930769766.png

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.