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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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 ) )
 
 
 
 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.