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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Distributor billing in a month

Hello all,

 

I have a sales table for primary sales. The sales data comes at Day, City, Product & Customer level.

 

Now I have to show the following for a month selection: (Month field is in a date table linked to the sales table)

 

 Product 1Product 2Product 3
Once a week10814
Twice a week211210
Thrice a wek51612

 

I have to show the frequency of the times that a product is billed for customers.

For eg: Product 1 is billed once a week for 10 customers, twice a week for 21 customers and thrice a week for 5 customers.

 

Please help me derive this logic.

Need urgent help.

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

First, you may go to Query Editor to use Week of Year to add a column.

1.png

Second, use IF or SWITCH Function to new a column to calculate different times a week. For example:

Times =
IF (
    COUNTX (
        FILTER (
            Table1,
            Table1[Week of Year] = EARLIER ( Table1[Week of Year] )
                && Table1[Product] = EARLIER ( Table1[Product] )
        ),
        Table1[Product]
    )
        = 1,
    "Once a week",
    "Twice a week"
)

1.png

Third, add a measure to calculate the numbers of customers.

NumberOfCustomers =
CALCULATE ( DISTINCTCOUNT ( Table1[Customer] ) )

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

First, you may go to Query Editor to use Week of Year to add a column.

1.png

Second, use IF or SWITCH Function to new a column to calculate different times a week. For example:

Times =
IF (
    COUNTX (
        FILTER (
            Table1,
            Table1[Week of Year] = EARLIER ( Table1[Week of Year] )
                && Table1[Product] = EARLIER ( Table1[Product] )
        ),
        Table1[Product]
    )
        = 1,
    "Once a week",
    "Twice a week"
)

1.png

Third, add a measure to calculate the numbers of customers.

NumberOfCustomers =
CALCULATE ( DISTINCTCOUNT ( Table1[Customer] ) )

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.