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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

PLEASE HELP ::: If holiday in date copy previous day data for that or give alternative solution

Dateentitysublogasset cr
07-12-2021ax1
07-12-2021ay10
07-12-2021az10
08-12-2021ax2
08-12-2021ay4
08-12-2021az1
09-12-2021ax3
07-12-2021bp2
07-12-2021bq2
07-12-2021br2
08-12-2021bp3
08-12-2021bq3
08-12-2021br3
09-12-2021bp4
07-12-2021bq4
07-12-2021cxx3
07-12-2021cyy3
08-12-2021czz3
08-12-2021cxx4
08-12-2021cyy4
09-12-2021czz4
07-12-2021az-10
07-12-2021bq3
07-12-2021cxx4
08-12-2021ay5
08-12-2021br6
08-12-2021czz7
09-12-2021ax1
09-12-2021az0
12-12-2021ax1
12-12-2021ay10
12-12-2021az0
14-12-2021ax2
14-12-2021ay4
14-12-2021az10
15-12-2021ax3
12-12-2021bp2
12-12-2021bq2
12-12-2021br2
14-12-2021bp3
14-12-2021bq3
14-12-2021br3
15-12-2021bp4
15-12-2021bq4
12-12-2021cxx3
12-12-2021cyy3
12-12-2021czz3
14-12-2021cxx4
14-12-2021cyy4
14-12-2021czz4
14-12-2021az-10
15-12-2021bq3
12-12-2021cxx4
12-12-2021ay5
12-12-2021br6
14-12-2021czz7
14-12-2021ax1
14-12-2021az0

 

Please refer above table as source data. called SHEET 1. 

 

And another source which give me holiday information below,

 

DayHoliday
07-12-2021FALSE
08-12-2021FALSE
09-12-2021FALSE
10-12-2021TRUE
11-12-2021TRUE
12-12-2021FALSE
13-12-2021TRUE
14-12-2021FALSE
15-12-2021FALSE

 

So basically from both table you got that whenever Holiday = TRUE , There are no data in SHEET1. so i wanted previous day data countabily over there.

 

SankeyThakkar_7_0-1638788195875.png

 

Reason why i required that:

 

Refer my below measures:

 

avg asset =
SUMX (
SUMMARIZE (
Sheet1,
Sheet1[entity],
Sheet1[sublog],
"Min Asset Value",
AVERAGEX(
SUMMARIZE (
Sheet1,
Sheet1[Date].[Date],
Sheet1[entity],
Sheet1[sublog],
"Asset_cr", SUMX ( Sheet1, Sheet1[asset cr] )
),
[Asset_cr]
)
),
[Min Asset Value]
)
 
Min_ asset =
SUMX (
SUMMARIZE (
Sheet1,
Sheet1[entity],
Sheet1[sublog],
"Min Asset Value",
MINX (
Filter(
SUMMARIZE (
Sheet1,
Sheet1[Date].[Date],
Sheet1[entity],
Sheet1[sublog],
"Asset_cr", SUMX ( Sheet1, Sheet1[asset cr] )
),
[Asset_cr] <> 0
),
[Asset_cr]
)
),
[Min Asset Value]
)
 
I need holiday dates also in visulisation with previous day data.
 
Required Output:
 
SankeyThakkar_7_1-1638789025621.png

 in power bi.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Create measures.

Measure 2 = CALCULATE(SUMX(Sheet1,Sheet1[asset cr]),FILTER(ALL('holiday information'),'holiday information'[Day]=MAXX(FILTER(ALL('holiday information'),'holiday information'[Day]<=MAX('holiday information'[Day])&&'holiday information'[Holiday]="FALSE"),'holiday information'[Day])))
Measure 3 = CALCULATE(AVERAGEX(Sheet1,Sheet1[asset cr]),FILTER(ALL('holiday information'),'holiday information'[Day]=MAXX(FILTER(ALL('holiday information'),'holiday information'[Day]<=MAX('holiday information'[Day])&&'holiday information'[Holiday]="FALSE"),'holiday information'[Day])))

11.PNG

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Create measures.

Measure 2 = CALCULATE(SUMX(Sheet1,Sheet1[asset cr]),FILTER(ALL('holiday information'),'holiday information'[Day]=MAXX(FILTER(ALL('holiday information'),'holiday information'[Day]<=MAX('holiday information'[Day])&&'holiday information'[Holiday]="FALSE"),'holiday information'[Day])))
Measure 3 = CALCULATE(AVERAGEX(Sheet1,Sheet1[asset cr]),FILTER(ALL('holiday information'),'holiday information'[Day]=MAXX(FILTER(ALL('holiday information'),'holiday information'[Day]<=MAX('holiday information'[Day])&&'holiday information'[Holiday]="FALSE"),'holiday information'[Day])))

11.PNG

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@amitchandak  OP sir.

 

but requirment is not 100% correct. I feel its because of i couldnot explain properly.

 

SankeyThakkar_7_0-1638795076444.png

 

Currently from your solution,

 

new measure22 =
calculate
(SUMX
( Sheet1, Sheet1[asset cr] ) , filter(ALL('Holiday data'),'Holiday data'[Day] = maxx(FILTER(ALL('Holiday data'),'Holiday data'[Day] <= MAX('Holiday data'[Day]) && 'Holiday data'[Holiday] = FALSE()),'Holiday data'[Day])))
 
is given wrong average at su category level and I want sum of all subcategory as category value.
 
You can refer my min asset formula,
 
Min_ asset =
SUMX (
SUMMARIZE (
Sheet1,
Sheet1[entity],
Sheet1[sublog],
"Min Asset Value",
MINX (
Filter(
SUMMARIZE (
Sheet1,
'Holiday data'[Day],
Sheet1[entity],
Sheet1[sublog],
"Asset_cr", SUMX ( Sheet1, Sheet1[asset cr] )
),
[Asset_cr] <> 0
),
[Asset_cr]
)
),
[Min Asset Value]
)
 
Thank you so much in advance.
 
Anonymous
Not applicable

@amitchandak @AlexisOlson @Greg_Deckler 

 

Kindly help masters pls

@Anonymous , Make sure this holiday flag is part of date table marked as date table and then try measure like

 

new measure =
calculate(SUMX ( Sheet1, Sheet1[asset cr] ) , filter(all('Date'), 'Date'[Date] = maxx(filter(all('Date'),'Date'[Date]<= max('Date'[Date]) && 'Date'[Holiday] =False()), 'Date'[Date])))

 

Use date from date table in visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors