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
Ritesh_Air
Post Patron
Post Patron

Last transaction date - Price

Hi Experts,

How do I ignore date slicer which have dates in future to show last transaction date of an item in the table?

 

Here is my problem:  

I want to find out the last transaction date and the price of an item.

Problem is, I have a slicer which has dates in future so I am getting blanks for item's sold date and it's price in the table.

 

Ritesh_Air_0-1609977993572.png

 


I want to see something like this: Included in the example tab of attached pbix.

 

Ritesh_Air_1-1609978051216.png

 

 

I have included the pbix and looking for what is shown in "Example" tab. How do I achieve that in "Net Sales Forecast" tab?

 

https://drive.google.com/file/d/1FpwrV-F2s_hRIvIMkrtQC35ncitgpV7R/view?usp=sharing

 


TIA,
-RK

1 ACCEPTED SOLUTION

Hi @Ritesh_Air ,

 

Thanks for your reply.

The following is my own solution. I would be honored if others have a better idea and can share it with me.

Based on your description, you can create a calculated table as follows.

 

Table = 

var x1=SUMMARIZE (

FILTER (

ALL ( 'Sales Order' ),

RELATED ( 'Item'[Item Number ID] ) <> BLANK ()

&& RELATED ( Customer[Has Sales] ) = 1

),

'Date'[Week Start],

'Customer'[Parent Retailer AB Number],

'Item'[Item Number ID],

"date day",MAX('Sales Order'[Day Date]),

"max_date",[Max - date],

"maxprice",[Max - date Price]

)

return

ADDCOLUMNS(x1,"max_price",MAXX(FILTER(x1,[Item Number ID]=EARLIER('Item'[Item Number ID])),[maxprice])

)

Result:

 

v-yuaj-msft_0-1610440659463.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

 

View solution in original post

6 REPLIES 6
v-yuaj-msft
Community Support
Community Support

Hi @Ritesh_Air ,

 

I did a test. Is the following result what you want?

v-yuaj-msft_0-1610433578626.png

 

Best Regards,

Yuna

 

@v-yuaj-msft Yuna, yes, that's what I am looking for. Can you please let me know how did you reach that?

 

TiA

Ritesh

Hi @Ritesh_Air ,

 

Thanks for your reply.

The following is my own solution. I would be honored if others have a better idea and can share it with me.

Based on your description, you can create a calculated table as follows.

 

Table = 

var x1=SUMMARIZE (

FILTER (

ALL ( 'Sales Order' ),

RELATED ( 'Item'[Item Number ID] ) <> BLANK ()

&& RELATED ( Customer[Has Sales] ) = 1

),

'Date'[Week Start],

'Customer'[Parent Retailer AB Number],

'Item'[Item Number ID],

"date day",MAX('Sales Order'[Day Date]),

"max_date",[Max - date],

"maxprice",[Max - date Price]

)

return

ADDCOLUMNS(x1,"max_price",MAXX(FILTER(x1,[Item Number ID]=EARLIER('Item'[Item Number ID])),[maxprice])

)

Result:

 

v-yuaj-msft_0-1610440659463.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

 

amitchandak
Super User
Super User

@Ritesh_Air , Try meausre like

calculate(lastnonblankvalue(Table[Date], max(Table[Price])), allexcept(Table, Table[item]))

or

calculate(lastnonblankvalue(Table[Date], max(Table[Price])), filter(all(Table), Table[item] =max(Table[item])))

Thanks Amit, I have tried both the formulas but I get blank, when I try to put it in the table shown in "Net Sales Forecast" tab in the attached pbix.

 

Ritesh_Air_0-1609988194297.png

 

@Ritesh_Air , Try like

Max - date Price = CALCULATE(LASTNONBLANKVALUE('Date'[Week Start], [Net Sales LY]),ALLEXCEPT('Item','Item'[Item Number ID]),ALLEXCEPT(Customer,Customer[Parent Retailer AB Number]),ALLSELECTED('Date'[Week Start]))

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.