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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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