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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
Super User
Super User

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!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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

 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors