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
vijayvizzu
Helper III
Helper III

Last Week comparison not working properly

Hi

I have created a measure to compare the current week value with last week value. Its working fine in some pages, but all.

 

X_Test_Measure = 

VAR _LW_Price = 
LASTNONBLANKVALUE(
        DATEADD(
            CalendarT[Date],
            -7,DAY
        ),
        [Total Value]
    )
VAR _CW_Price =
    LASTNONBLANKVALUE(
        CalendarT[Date],
        [Total Value]
    )
RETURN 
IF( ISBLANK( [Total Value]),BLANK(),_CW_Price-_LW_Price)

 Below matrix value shows me correct values, but when i am putting into a matrix visual as top level info it gives me blank.Unable to find out the error

vijayvizzu_0-1626945397139.png

vijayvizzu_1-1626945439805.png

 

7 REPLIES 7
v-janeyg-msft
Community Support
Community Support

Hi, @vijayvizzu 

 

There is a suitable context in the matrix so it is displayed correctly. Since your measure contains other measure, we can't judge why there is a blank based on the information you provide. If you can't provide data, I think you need to check whether the context and the measure are in harmony.

vjaneygmsft_0-1627282651127.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.


Best Regards,

Community Support Team _ Janey

 

Hi @v-janeyg-msft  @amitchandak 

I understood the problem, unable to fix it

The problem is that, if the date selection ranges between weekly published dates, then it calculates the numbers correctly, but we selected the beyond that publish date, then it won works

 

Example,

I have the publish dates till 30th Jun 2021, in the date slicer, if i will select 7th Jul (greater than publish date), then it won't work because there was no values in that date range. So, how can i elimate the user to select the beyond the publish dates. 

Hi, @vijayvizzu 

 

If you are talking about date slicer, then you can directly control the range of date selection on the filterpane to meet your needs.

Like this:

vjaneygmsft_0-1627469411766.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

@v-janeyg-msft 

Thanks for the suggestion, but how it can be dynamic ? I want to filter publish dated for a particular Source only, i have multiple sources in my main table. 

Hi, @vijayvizzu (I took a long vacation due to illness)

 

 

I don't know your specific thoughts, but it should be possible.

vjaneygmsft_0-1630915237463.png

You can create a measure and use it in filter pane to filter date dynamically like this:

vjaneygmsft_1-1630916508437.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.


Best Regards,

Community Support Team _ Janey

 

amitchandak
Super User
Super User

@vijayvizzu , Make sure Cw_no is coming from the date table .

 

or

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

refer if needed

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Thank you, but i can't able to upload any document as my PC doesnt allow me to upload anything

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.

Top Solution Authors