cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
gsulaimon Frequent Visitor
Frequent Visitor

divide in row

power bi.JPGi want to divide this by each other to give the % but i have been finding it difficult

power bi.JPGi want to divide this by each other to give the % but i have been finding it difficult

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: divide in row

@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
VijayP Regular Visitor
Regular Visitor

Re: divide in row

Can you please rephrase your question. Its not clear

Community Support Team
Community Support Team

Re: divide in row

@gsulaimon ,

 

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

 

Regards,

Jimmy Tao

gsulaimon Frequent Visitor
Frequent Visitor

Re: divide in row

@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

 

 

       

Community Support Team
Community Support Team

Re: divide in row

@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

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 387 members 3,200 guests
Please welcome our newest community members: