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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Creating Measure to Categorise an ID based on other columns

Hello,

 

Data Table - 

 

CustomerProduct Ordered
AAATablet
AAAMobile
AAAMouse
BBBMobile
BBBMouse
CCCMobile
DDDTablet

 

I'm trying to create a measure that gives me below output, it seems pretty easy one but not able to figure out what DAX statements to use, any advice or help on this would be appreciated. Thanks

 

Desired Output - 

 

Customers ordering multiple productsCustomer Ordering Mobile OnlyCustomer Ordering Tablet Only
AAACCCDDD
BBB  
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

Please check if the below picture is what you are looking for.

The sample pbix file's link is down below, and all measures are written in the file.

Picture4.png

https://www.dropbox.com/s/3zcylylytidjsn6/Mrugankjoshi.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

Please check if the below picture is what you are looking for.

The sample pbix file's link is down below, and all measures are written in the file.

Picture4.png

https://www.dropbox.com/s/3zcylylytidjsn6/Mrugankjoshi.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Exactly what I was looking for, appreciate your help! 👍정말 감사합니다

selimovd
Super User
Super User

Hey @Anonymous ,

 

you can try that with the following measures:

For the multiple products:

Customers ordering multiple products = 
VAR vCustomers =
FILTER (
    ADDCOLUMNS (
        VALUES ( MyTable[Customer] ),
        "NumberSales", CALCULATE ( COUNTROWS ( MyTable ) )
    ),
    [NumberSales] > 1
)

RETURN
SUMX(vCustomers, [NumberSales])

 

The amount of mobile:

Customer Ordering Mobile Only = 
CALCULATE(
    COUNTROWS( MyTable ),
    MyTable[Product Ordered] = "Mobile"
)

 

And tablet:

Customer Ordering Tablet Only = 
CALCULATE(
    COUNTROWS( MyTable ),
    MyTable[Product Ordered] = "Tablet"
)

 

The result looks then like that:

8.png

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

Thank you, that was helpful 👍

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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