Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Power Bi to show only Net Values for Current week compared to previous week.

Hi All, Struggling to find a logic to create a measure to identify and return only values which are new compared to previous week. below is the sample data. As show in the below table measure should only return highlighted in bold italic. 

DateIDNameGroup
21/11/2022F046DamianA
21/11/2022F047DanielA
21/11/2022F048DavidA
21/11/2022F049DebbieA
21/11/2022F050DespinaA
21/11/2022F051ElkeB
21/11/2022F052ErikalynB
21/11/2022F053FelicityB
21/11/2022F054FionaC
21/11/2022F055GaryD
28/11/2022F046DamianA
28/11/2022F047DanielA
28/11/2022F048DavidA
28/11/2022F049DebbieA
28/11/2022F050DespinaA
28/11/2022F051ElkeB
28/11/2022F052ErikalynB
28/11/2022F053FelicityB
28/11/2022F054FionaC
28/11/2022F055GaryD
28/11/2022F056JamesA
28/11/2022F054FionaB
28/11/2022F055GaryB
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can follow the steps below to get it, please find the details in the attachment.

1. Create a measure as below

Flag = 
VAR _selid =
    SELECTEDVALUE ( 'Table'[ID] )
VAR _selname =
    SELECTEDVALUE ( 'Table'[Name] )
VAR _selgroup =
    SELECTEDVALUE ( 'Table'[Group] )
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[ID] = _selid
                && 'Table'[Name] = _selname
                && 'Table'[Group] = _selgroup
                && 'Table'[Date] < _maxdate
        )
    )
RETURN
    IF ( ISBLANK ( _count ), 1, 0 )

2. Create a table visual and apply the visual-level filter with the condition(Flag is 1)

yingyinr_0-1670228831839.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can follow the steps below to get it, please find the details in the attachment.

1. Create a measure as below

Flag = 
VAR _selid =
    SELECTEDVALUE ( 'Table'[ID] )
VAR _selname =
    SELECTEDVALUE ( 'Table'[Name] )
VAR _selgroup =
    SELECTEDVALUE ( 'Table'[Group] )
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[ID] = _selid
                && 'Table'[Name] = _selname
                && 'Table'[Group] = _selgroup
                && 'Table'[Date] < _maxdate
        )
    )
RETURN
    IF ( ISBLANK ( _count ), 1, 0 )

2. Create a table visual and apply the visual-level filter with the condition(Flag is 1)

yingyinr_0-1670228831839.png

Best Regards

ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

Create the following dax:

Previous week filter = IF(ISBLANK(
    CALCULATE(MAX('Table (14)'[Name]),MAX('Table (14)'[Date])-7='Table (14)'[Date],ALL('Table (14)'[Date]))),
    1,0)

Place it into filter:
ValtteriN_0-1669986326199.png

 

This will return the desired values + values which don't have value 3 weeks ago (since there is no data before this):
ValtteriN_1-1669986382401.png

 

Now you can create maxdate filter measure or use relative date filtering:
ValtteriN_2-1669986427068.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.