Forum Discussion

joaopalhares's avatar
joaopalhares
Frequent Visitor
5 years ago
Solved

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:

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

 

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

Files 

  • wdx223_Daniel's avatar
    wdx223_Daniel
    5 years ago

    add a new column in table of sheet1

    and, create a relationship between the new column to dimTable

    then change the measure code of StoreCount to

     

6 Replies

    • joaopalhares's avatar
      joaopalhares
      Frequent Visitor

      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.

       

      Your help would be awesome. Thanks in advance.

       

      Updated files on the link below.

      Updated Files 

      • wdx223_Daniel's avatar
        wdx223_Daniel
        Community Champion

        add a new column in table of sheet1

        and, create a relationship between the new column to dimTable

        then change the measure code of StoreCount to

         

  • 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 ) )
     
     
     
     
    • joaopalhares's avatar
      joaopalhares
      Frequent Visitor

      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.

       

      Your help would be awesome. Thanks in advance.

       

      Updated files on the link below.

      Updated Files