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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
gsulaimon
Frequent Visitor

divide in row

i want to divide this by each other to give the % but i have been finding it difficulti want to divide this by each other to give the % but i have been finding it difficult

i want to divide this by each other to give the % but i have been finding it difficulti want to divide this by each other to give the % but i have been finding it difficult

1 ACCEPTED SOLUTION

@gsulaimon ,

 

In query editor, create an index from 1, then create a calculate column using dax below:

Result = 
VAR Current_Index = 'Table'[Index]
VAR Current_Value = 'Table'[value]
RETURN
IF(MOD(Current_Index, 2) <> 0,  Current_Value / CALCULATE(MAX('Table'[value]), FILTER('Table', 'Table'[Index] = Current_Index + 1)))

Capture.PNG 

Community Support Team _ Jimmy 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

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@gsulaimon ,

 

Could you please share the sample data and give the expected result?

 

Regards,

Jimmy Tao

VijayP
Community Champion
Community Champion

Can you please rephrase your question. Its not clear




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@v-yuta-msft @VijayP 

 

KPIs       value

 

ABC        18

 

ade       18

 

wade    27

 

def      27 

 

 

I want to divide the row's value by each other 

 i.e wade/def 

       ABC/ade

I need a DAX expression what would help achieve this

 

 

       

@gsulaimon ,

 

In query editor, create an index from 1, then create a calculate column using dax below:

Result = 
VAR Current_Index = 'Table'[Index]
VAR Current_Value = 'Table'[value]
RETURN
IF(MOD(Current_Index, 2) <> 0,  Current_Value / CALCULATE(MAX('Table'[value]), FILTER('Table', 'Table'[Index] = Current_Index + 1)))

Capture.PNG 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.