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
Anonymous
Not applicable

How to Lookup or Return text for Selected Date

Hi all,

 

Please see below screen-cap, I would like to return the Pricing Model for selected month.

 

For example, I have selected date (201904) and the SKU 45779A.

 

Can I use lookupvalue or calculate function to return the value "Regular" (Pricing Model for 201904)?

(Tried to use below, but will error)

Pricing Model = LOOKUPVALUE('Wayfair Net WS Price'[ Pricing Model],'Wayfair Net WS Price'[Year_Month],[Current Month])

 

I hope I can explain myself clearly. Please let me know if I need to upload the whole power bi file

 

11.png

12.png

1 ACCEPTED SOLUTION

@Anonymous 

 

Try this MEASURE

 

Wayfair Pricing Model =
VAR mymonth = [Current Month]
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( 'Wayfair Net WS Price'[ Pricing Model] ),
            'Wayfair Net WS Price'[Year_Month] = mymonth
        ),
        [ Pricing Model],
        ","
    )

Regards
Zubair

Please try my custom visuals

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Are you using a measure or a calculated column

Anonymous
Not applicable

I believe I need to use measure.....But I am quite new to PowerBI and still not 100% understand the logic

@Anonymous 

 

Try this MEASURE

 

Wayfair Pricing Model =
VAR mymonth = [Current Month]
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( 'Wayfair Net WS Price'[ Pricing Model] ),
            'Wayfair Net WS Price'[Year_Month] = mymonth
        ),
        [ Pricing Model],
        ","
    )

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Hi Zubair_Muhammad,

 

Great thanks. It is working prefectly.

 

I will learn the CONCATENATEX

@Anonymous 

 

Concatenatex is not necessary if there are no duplicates.

 

If 2 or more models meet the criterion then CONCATENATEX will avoid the error " a table of multiple values was supplied"

So if you use following, it should work as well

 

Wayfair Pricing Model =
VAR mymonth = [Current Month]
RETURN
    CALCULATETABLE (
        VALUES ( 'Wayfair Net WS Price'[ Pricing Model] ),
        'Wayfair Net WS Price'[Year_Month] = mymonth
    )

 

 


Regards
Zubair

Please try my custom visuals
CheenuSing
Community Champion
Community Champion

Hi @Anonymous 

 

Can you please upload the pbix file in One Drive / Google Drive and share the link here.

 

Also the output you expect for your scenario.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
Anonymous
Not applicable

Hi CheenuSing,

 

Thanks for your help, below is the pbix link.

https://drive.google.com/open?id=1AtDMI5KqBwP1m_-xqsYh6ov6bMQh7dPC

 

Please go to "Wayfair Analytics" tab and I would like to add "Pricing Model" column  to the bottom right hand corner table

 

I store the Pricing Model data in the table "Wayfair Net WS Price" and created a measure "Wayfair Pricing Model" under "Product Margin" (but is not working now).

 

The SKU # 45779A is a good example as a demo as it change from "EDLP" to "Regular" in 201904

YearMonthSales UnitAvg Sell $Wholesales $Net Wholesales $Wayfair Margin $Wayfair Margin %Pricing Model
2019January $295.14$184.44$175.22$119.9340.63%EDLP
2019February $307.80$196.06$186.26$121.5539.49%EDLP
2019March7$297.57$196.06$186.26$111.3137.41%EDLP
2019April6$293.17$260.96$227.03$66.1422.56%Regular
2019May    N/AN/AN/A
2019June    N/AN/AN/A
2019July    N/AN/AN/A
2019August    N/AN/AN/A
2019September    N/AN/AN/A
2019October    N/AN/AN/A
2019November    N/AN/AN/A
2019December    N/AN/AN/A

 

Just free feel to let me know if you need further explanation on the dashboard structure. Thanks.

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.