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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dkbbr
Regular Visitor

Sales total combine.

How you guy's find a combined total sales? I find Total sales for each of them but it's customers and drivers separated. how you combine them. adding new column like "Role" using dax( i don't really need extra column)

DateCustomerPkIdCustomerNameDriverPkidDriverNameSaleAmount
24/01/011001Jhon2001Brain1000
24/01/021002jon2002Brown1250
24/01/021003jin2001Brain4502
24/01/031002jon2003Tom12515
24/01/041001jhon2004Toms1412

 

I wanna look like this after writing DAX :

 

NameRoleSale
JhonCustomer2412
BrainDriver5502
   
3 REPLIES 3
v-jiewu-msft
Community Support
Community Support

Hi @dkbbr ,

Based on the description, @rajendraongole1 the response provides the desired results. It should be helpful to you.

If you have solved the problem, please please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Wisdom Wu

rajendraongole1
Community Champion
Community Champion

Hi @dkbbr - you can create a new calculated table with combining the sales data for customers and drivers.

 

CombinedSales =
UNION(
    SELECTCOLUMNS(
        FILTER('Cmbine', NOT(ISBLANK('Cmbine'[CustomerPkId]))),
        "Name", 'Cmbine'[CustomerName],
        "Role", "Customer",
        "Sale", 'Cmbine'[SaleAmount]
    ),
    SELECTCOLUMNS(
        FILTER('Cmbine', NOT(ISBLANK('Cmbine'[DriverPkid]))),
        "Name", 'Cmbine'[DriverName],
        "Role", "Driver",
        "Sale", 'Cmbine'[SaleAmount]
    )
)

 

rajendraongole1_0-1718621643372.png

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"?

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.