cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kenny_i Member
Member

How to create new column? Need amount based on CustomerName

I have columns  "DateTime", "SalesId", "CustomerName" and "Amount" in SQL Server.

 

I would like to have Toyota Amount and Nissan Amount in Power BI Report based on "CustomerName" = "Toyota" and its "Amount". Needed columns in table report is Month, ToyotaAmount, Nissan Amount, How to do it? Maybe with Dax? Should new calculated column created or new

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-cherch-msft
Microsoft

Re: How to create new column? Need amount based on CustomerName

Hi @kenny_i 

You may create a Month column for Data table and then create two measures like below to get the table.For example:

Nissan Amount = CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[CustomerName]="Nissan"))
Toyota Amount = CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[CustomerName]="Toyota"))

1.png

Regards,

 

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

1 REPLY 1
Microsoft v-cherch-msft
Microsoft

Re: How to create new column? Need amount based on CustomerName

Hi @kenny_i 

You may create a Month column for Data table and then create two measures like below to get the table.For example:

Nissan Amount = CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[CustomerName]="Nissan"))
Toyota Amount = CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[CustomerName]="Toyota"))

1.png

Regards,

 

Community Support Team _ Cherie Chen
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
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)