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 avoid historical data in table view (Should see the record based on latest date).

Hi All,

 

Hope you are doing well, I have a requirement (I have tried in many  ways but nothing worked). Please help with this requirement.

BusiVivek03_0-1683529042708.png

Req 1:

  • Show the records only of the latest date based of the Id or Id and Status. The view should be as shown below.
    BusiVivek03_1-1683529485815.png

Req 2:

  • In KPI "Sum of QTY" must to be 5 instead of 15 (the Qty is duplicated based on the Id).

I apperciate you for your time in helping me.

 

Thank you,

Regards
Vivek B

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,Try measures like, add to visual with all other field as not summarized

 

Last Qty = Var _max = maxx(filter( ALLSELECTED(Data1), Data1[ID] = max(Data1[ID]) ),Data1[Date])
return 
CALCULATE(sum(Data1[qty]), filter( (Data1), Data1[ID] = max(Data1[ID])  && Data1[Date] =_max))



Sum Last Qty = sumx(VALUES(Data1[ID]) , [Last Qty])

 

Follow the approach in my blog  https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee884e

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,Try measures like, add to visual with all other field as not summarized

 

Last Qty = Var _max = maxx(filter( ALLSELECTED(Data1), Data1[ID] = max(Data1[ID]) ),Data1[Date])
return 
CALCULATE(sum(Data1[qty]), filter( (Data1), Data1[ID] = max(Data1[ID])  && Data1[Date] =_max))



Sum Last Qty = sumx(VALUES(Data1[ID]) , [Last Qty])

 

Follow the approach in my blog  https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee884e

Anonymous
Not applicable

Hi Amit,

I have one doubt. from the below table I need to get Total Qty=55 instead of 152. Can please help me here. Based on distinct Project ID I need the total Qty. 

BusiVivek03_0-1683545028583.png

Thank you for your time.

Regards 

Vivek B

 

Anonymous
Not applicable

Hi Amit,

Thanks for quick response, and the DAX you provided is also working fine.

 

Regards

Vivek

 

 

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.