cancel
Showing results for
Did you mean:

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

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:

 Row Table1: Customer (Registered Month) Table1: Customer (Customer Number) Table2:Card Pricing type (Pricing Type Name) Table3:Item (Item Name) Table4:Sales measures(#Quantity) 1. 11 01 A a 5000 2. 11 01 B other 600 3. 11 01 B other 2000 4. 11 01 C other 0 5. 11 01 C other 40 6. 11 02 C a 51 7. 11 03 C other 43 8. 11 04 A other 61 9. 10 05 C a 85 10. 10 06 C other 93 11. 10 06 C other 109 12. 10 06 C other 222 13. 10 06 C other 90 14. 10 07 A other 432

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:

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 11 1 B 11 2 C 11 1 A 10 2 C 10 1 A

Thank You! Any help is welcome.

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/

Announcements

#### New forum boards available in Real-Time Intelligence.

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

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors