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
hilary_tesillo
Advocate I
Advocate I

Show sales of same weekday if the measure is blank

Hi.

I have this table with the Sales for every day in the month, and I have a second measur called "Sales LM DWY" that corresponds to the last month sales for the same weekday in the same week (1 april was the first friday of the month in the first week so in Sales LM DWY shows the sales of March 4 (that was the first friday of march in the first week of the month)).

 

I have the problem that for the last two days of April it doesn´t show any value because it doesn´t find the matching weekday and week, so I would like to show instead of blanks the first matching weekday in the same month (For April 29 it should show the sales of April 1st and for April 30 it should show the sales of April 2nd).

 

I'm struggling to find a solution to do this, I'd appreciate any help. 

 

hilary_tesillo_1-1652481242045.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@hilary_tesillo , This is usually 28 days behind sales

example with date table

Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-28,Day))

 

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

View solution in original post

3 REPLIES 3
Whitewater100
Solution Sage
Solution Sage

Hi:

Do you want to try this measure?

Test =
var currdate = MAX(Dates[Date])
var sales401 = CALCULATE([Sales], Dates[Date] = DATE(2022,4,1))
var sales402 = CALCULATE([Sales], Dates[Date] = DATE(2022,4,2))
return
IF(currdate = DATE(2022,4,29), sales401,
IF(currdate = DATE(2022,4,30), sales402,
[Sales LM DWY]))
amitchandak
Super User
Super User

@hilary_tesillo , This is usually 28 days behind sales

example with date table

Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-28,Day))

 

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Hi,

 

Oh, I think it's not possible, because it's a function, but you can substitute the blank to a character or a word if it helps.

 

The structure is like:

 

if[values] = blank; "no match"

 

In this case, when the value equals blank, instead nothing we gonna have "no match"

Regards!

 

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.