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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Fahim78666
Regular Visitor

Power bi

I need to know how to calculate the sales category on general customers

For example how many sales completed from the range of $1 to 50 and $50 to $100

Please help me to do this using power bi

 

Thanks 

13 REPLIES 13
Fahim78666
Regular Visitor

Can you please explain me how database relationships works

how to know on how to create relationship

 

Anonymous
Not applicable

Hi @Fahim78666 

Please refer to the following document:
Model relationships in Power BI Desktop - Power BI | Microsoft Learn

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fahim78666_0-1728006458297.png

why im getting every values same

 

Anonymous
Not applicable

Hi @Fahim78666 

Please provide sample data that fully covers your issue and the expected outcome based on the sample data you provided.

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

the database i have is BAK file 

 

Can you please do remote Access and check on the stated issue 

 

Can you ??

Anonymous
Not applicable

Hi @Fahim78666 

Due to security policies, we cannot perform remote operations. You can review the PBIX file I provided earlier and modify the DAX based on your existing data.

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar question in the attached PBI file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Fahim78666 

Based on your needs, I have created the following table.

vjialongymsft_0-1727750107386.png

 

 

First of all, you need to categorize the sales of different customers

category = IF(SELECTEDVALUE('Table'[sales])>=1 && SELECTEDVALUE('Table'[sales])<50,
"$1 to 50" ,
IF(SELECTEDVALUE('Table'[sales])>=50 && SELECTEDVALUE('Table'[sales])<=100,
"$50 to $100",
BLANK()))

 

Then count the different sales categories.

count = 
VAR _category = [category]
VAR _count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[category]=_category))

RETURN _count

 

vjialongymsft_1-1727750412392.png

 

 

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fahim78666
Regular Visitor

i have 3 tables name 

Translines, Transheader and transpayment

how can i use this 3 table to find the stated above

Fahim78666_0-1727684440101.png

 

Can you please explain me how database relationships works

how to know on how to create relationship

 

Please share a pbx file with sample dataset and expected outcome 

I just have a BAK file 

 

Can you please login through remote Access and check

Jpss
Resolver II
Resolver II

@Fahim78666 , 
you need to create a calculated column with the bucket / range that you need to count
that will help you get a count of rows per range. 

Please see this file :Fahim78666 _ jpssSol.pbix

If you find this helpful, Consider marking this as a solution.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors