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
uie07923
Frequent Visitor

Challenge: Find out new records from last update

Hi Colleagues!

 

I have a report that is downloaded in every working day.

It brings a list of materials and records of alerts (like risks of shortages, MRP exceptions).

The question asked every day is: "what are the items that had new messages or increases from the last update to today?"

uie07923_0-1622461282427.png

What we do is a pivot table and manually identify these (as per example above).

How can I make this identification in Power BI?

1 ACCEPTED SOLUTION
AlB
Super User
Super User

@uie07923 

Try this measure:

Measure =
VAR currentDate_ =
    SELECTEDVALUE ( Table1[Data Report] )
VAR prevDate_ =
    CALCULATE ( MAX ( Table1[Data Report] ), Table1[Data Report] < currentDate_ )
VAR currentVal_ =
    COUNT ( Table1[Data Report] )
VAR prevVal_ =
    CALCULATE ( COUNT ( Table1[Data Report] ), Table1[Data Report] = prevDate_ )
VAR diff_ = currenVal_ - prevVal_
RETURN
    IF ( diff_ > 0, diff_ )

   

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

3 REPLIES 3
AlB
Super User
Super User

@uie07923 

Try this measure:

Measure =
VAR currentDate_ =
    SELECTEDVALUE ( Table1[Data Report] )
VAR prevDate_ =
    CALCULATE ( MAX ( Table1[Data Report] ), Table1[Data Report] < currentDate_ )
VAR currentVal_ =
    COUNT ( Table1[Data Report] )
VAR prevVal_ =
    CALCULATE ( COUNT ( Table1[Data Report] ), Table1[Data Report] = prevDate_ )
VAR diff_ = currenVal_ - prevVal_
RETURN
    IF ( diff_ > 0, diff_ )

   

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

uie07923
Frequent Visitor

Something like this:

 

uie07923_0-1622469063128.png

The pivot table is just a Count of lines:

 

uie07923_1-1622469111281.png

 

AlB
Super User
Super User

Hi @uie07923 

Can you show a sample of the underlying table that you use for the pivot? and an example of the calculation based on that data?

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

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.