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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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 ) )
 
 
 
 


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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