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

Calculating Customer Number by Pricing Type in Power BI Live Connection

Hello!
Being quite new to Power BI, I am struggling with some measures in PBI Desktop Live Connection.
There are four separate tables which data fields needs to be combined into a measure: Customer table, Card Pricing Type, Item, Sales measures. The fields from the four tables appears as shown below:

RowTable1: Customer (Registered Month)Table1: Customer (Customer Number)Table2:
Card Pricing type (Pricing Type Name)
Table3:
Item (Item Name)
Table4:
Sales measures
(#Quantity)
1.1101Aa5000
2.1101Bother600
3.1101Bother2000
4.1101Cother0
5.1101Cother40
6.1102Ca51
7.1103Cother43
8.1104Aother61
9.1005Ca85
10.1006Cother93
11.1006Cother109
12.1006Cother222
13.1006Cother90
14.1007Aother432

 

The 1st measure should calculate the Pricing Type Name for each customer with following conditions: if a customer has several Pricing Types, e.a. Customer No.1 has A, B, C, then to this customer the Pricing type should be assigned according to the highest quantity by Item Name. But if Pricing Type Name equals "A" and Item name equals "a" (1st row from example), then the Pricing type name should be assigned according to second biggest quantity for that customer. (The customer with it's needed Pricing Type Name is marked in green).
I have been trying to write the 1st measure like the following:

evesin_1-1638351848188.png

 

The 2nd measure should calculate the number of Customers for each Pricing Type Name by Registered Month.

 

The result output of both measures should look like this in a table visual:

 

Month#Count of Customer number#Pricing Type
111B
112C
111A
102C
101A

 

Thank You! Any help is welcome.

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , for that binning or bucketing and for live you have to do to it at the source dataset level

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

 

https://www.daxpatterns.com/dynamic-segmentation/

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.