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


Go to My LinkedIn Page


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

Top Solution Authors