Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Need Help on creating measures

Hi,


I wish to have a slicer with below logic in one measure, please help me

  • First measure is for  slicer Which has “Store”, “Online Store”, & “Non Store” (Slicer Names)

If “Store location” = “Product Delivery Store Location” get matched then table should filter not matched rows,

If “Store” =” Online Store” then display rows which has Value ”Store”

If “Store” =” Non Store” then display rows which has Value ” Store”

If “Store” =” Non Store” then display rows which has Value ”Non Store”

 

  • Second measure is for  those customers whose purchased product from store (Refer Store ID column) but they show “Online Store” in Delivered Product Store ID column

If “Store”( refer store Location column) = ”Store”(refer Product Delivery Store location column) then display rows which has Value ”Online Store”

 

 

Sample Data

  • Hi Anonymous ,

     


    Anonymous wrote:

    Hi,


    I wish to have a slicer with below logic in one measure, please help me

    • First measure is for  slicer Which has “Store”, “Online Store”, & “Non Store” (Slicer Names)

    If “Store location” = “Product Delivery Store Location” get matched then table should filter not matched rows,

    If “Store” =” Online Store” then display rows which has Value ”Store”

    If “Store” =” Non Store” then display rows which has Value ”Store”

    If “Store” =” Non Store” then display rows which has Value ”Non Store”

     

    • Second measure is for  those customers whose purchased product from store (Refer Store ID column) but they show “Online Store” in Delivered Product Store ID column

    If “Store”( refer store Location column) = ”Store”(refer Product Delivery Store location column) then display rows which has Value ”Online Store”

     

     

    Sample Data


    Sorry, I'm a little confused about this.

    What do you want to express?

    If “Store” =” Online Store” then display rows which has Value ”Store”

    If “Store” =”Non Store” then display rows which has Value ” Store”

    If “Store” =” Non Store” then display rows which has Value ”Non Store”

    I created a pbix file based on my understanding to see if it meets your needs.

     

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • VijayP's avatar
    VijayP
    Community Champion

    Anonymous 

    Create a Small dummy table with Store List 

    Then with the help of SELECTEDVALUE create a trigger = 

    e.g., Selection = SELECTEDVALUE(NewTable[Storetype])

    then create a measure to have only those rows are sorted

    Swith(TRUE(),
    ([Selection]="Online",Calculate(total,filter(FactTable),Storetype = "Online)),....and so on

    Else use this file https://drive.google.com/file/d/1Jp_TBqIes8RzZJxPB4i0JwwWwgteO74F/view?usp=sharing

     

    Also you can watch my Videos on Power BI (100 Videos) at www.youtube.com/perepavijay

    Please Share Kudoes and if this solves your problem statement please mark this as solution 

    Thanks

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Anonymous ,

     


    Anonymous wrote:

    Hi,


    I wish to have a slicer with below logic in one measure, please help me

    • First measure is for  slicer Which has “Store”, “Online Store”, & “Non Store” (Slicer Names)

    If “Store location” = “Product Delivery Store Location” get matched then table should filter not matched rows,

    If “Store” =” Online Store” then display rows which has Value ”Store”

    If “Store” =” Non Store” then display rows which has Value ”Store”

    If “Store” =” Non Store” then display rows which has Value ”Non Store”

     

    • Second measure is for  those customers whose purchased product from store (Refer Store ID column) but they show “Online Store” in Delivered Product Store ID column

    If “Store”( refer store Location column) = ”Store”(refer Product Delivery Store location column) then display rows which has Value ”Online Store”

     

     

    Sample Data


    Sorry, I'm a little confused about this.

    What do you want to express?

    If “Store” =” Online Store” then display rows which has Value ”Store”

    If “Store” =”Non Store” then display rows which has Value ” Store”

    If “Store” =” Non Store” then display rows which has Value ”Non Store”

    I created a pbix file based on my understanding to see if it meets your needs.

     

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.