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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joaopalhares
Frequent Visitor

Calculating Stores by Transaction Range

Hello,

 

I would like to ask for help on the following problem:

 

I have an excel database which have the total number of transactions per store and date.

 

Then, i summarize the total number of transactions per store on power bi through the measure sum(transactions).

 

Generating this visual:

joaopalhares_1-1628122036022.png

Then, I want to count how many stores have more then 100 transactions and how many have equal or less to 100 transactions. Getting a visual like this (i did in excel just as an example):

joaopalhares_2-1628122146017.png

 

You can find all the files (.pbix and excel) on the link below for better visualization and analysis:

Files 

1 ACCEPTED SOLUTION

add a new column in table of sheet1

wdx223_Daniel_0-1628209232515.png

and, create a relationship between the new column to dimTable

wdx223_Daniel_1-1628209287754.png

then change the measure code of StoreCount to

wdx223_Daniel_2-1628209334446.pngwdx223_Daniel_3-1628209350650.pngwdx223_Daniel_4-1628209360301.png

 

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

More than 100 : =
VAR _newtable =
ADDCOLUMNS ( VALUES ( Sheet1[Store] ), "@transactions", [Total Transactions] )
RETURN
COUNTROWS ( FILTER ( _newtable, [@transactions] > 100 ) )
 
Equal or less than 100 : =
VAR _newtable =
ADDCOLUMNS ( VALUES ( Sheet1[Store] ), "@transactions", [Total Transactions] )
RETURN
COUNTROWS ( FILTER ( _newtable, [@transactions] <= 100 ) )
 
 
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hello @JihwanKim . Thank you for the support given.

 

It worked really nice. I've tried both ways, the one provided by you and @wdx223_Daniel

 

There is one other thing i would like your help to evaluate if it is possible:

Is it possible to, when i select (press) the number of stores count to filter the other table?

For instance, when i click the number 1 (more than 100) to filter the other table showing only store B.

joaopalhares_0-1628183448647.png

 

Your help would be awesome. Thanks in advance.

 

Updated files on the link below.

Updated Files 

wdx223_Daniel
Super User
Super User

create a dimension table

wdx223_Daniel_0-1628133291659.png

and create a measure

wdx223_Daniel_1-1628133331029.png

 

Hello @wdx223_Daniel wdx223_daniel . Thank you for the support given.

 

It worked really nice. I've tried both ways, the one provided by you and @Jihwan_Kim . 

 

There is one other thing i would like your help to evaluate if it is possible:

Is it possible to, when i select (press) the number of stores count to filter the other table?

For instance, when i click the number 1 (more than 100) to filter the other table showing only store B.

joaopalhares_0-1628183448647.png

 

Your help would be awesome. Thanks in advance.

 

Updated files on the link below.

Updated Files 

add a new column in table of sheet1

wdx223_Daniel_0-1628209232515.png

and, create a relationship between the new column to dimTable

wdx223_Daniel_1-1628209287754.png

then change the measure code of StoreCount to

wdx223_Daniel_2-1628209334446.pngwdx223_Daniel_3-1628209350650.pngwdx223_Daniel_4-1628209360301.png

 

Thank you! 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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