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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculated Measure

Hi All,

 

I have a situation where I have a Quarter end data for a particular column "CW_QTR_END" in my report.

So now i want to duplicate that value for all the dates in my report.

 

Below is the dax I've used but it is not giving me the desired result. 
ideally as the dates before 31st should be filled up with the value from the 31st i.e 16.70M

 

Need suggestions !!!

 

Himanshu_1306_0-1698332880469.png

 

DAX USED:

 

Fill_blanks =
var _a =
CALCULATE(MAX(VW_F_PIPELINE_SALES_HIERARCHY[DS]),FILTER(ALL(VW_F_PIPELINE_SALES_HIERARCHY),VW_F_PIPELINE_SALES_HIERARCHY[DS]<=MAX(VW_F_PIPELINE_SALES_HIERARCHY[DS]) && VW_F_PIPELINE_SALES_HIERARCHY[CW_QTR_END]<>BLANK()),VW_F_PIPELINE_SALES_HIERARCHY[FISCAL_QUARTER] = "FY24 Q2")

 var _b =
 CALCULATE(SUM(VW_F_PIPELINE_SALES_HIERARCHY[CW_QTR_END]),FILTER(ALL(VW_F_PIPELINE_SALES_HIERARCHY),VW_F_PIPELINE_SALES_HIERARCHY[DS]>=_a),VW_F_PIPELINE_SALES_HIERARCHY[FISCAL_QUARTER] = "FY24 Q2")

 return
 IF(SUM(VW_F_PIPELINE_SALES_HIERARCHY[CW_QTR_END])=BLANK() && _a<>BLANK(),_b,SUM(VW_F_PIPELINE_SALES_HIERARCHY[CW_QTR_END]))

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

What you need is to fill in the previous date with the value of the largest date. Then you can create the following measure:

Measure = var _max=CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
return CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Date]=_max))

vstephenmsft_0-1698732557765.png

If you also need to make up by group, for example, by month, the value of the largest day of the month should be used to fill in the previous date. You can do the following:

First create a monthyear column.

vstephenmsft_1-1698732729185.png

Then create a measure:

Measure 2 = var _max=CALCULATE(MAX('Table'[Date]),FILTER(ALLSELECTED('Table'),[MonthYear]=MAX('Table'[MonthYear])))
return CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Date]=_max))

vstephenmsft_2-1698732842579.png

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

What you need is to fill in the previous date with the value of the largest date. Then you can create the following measure:

Measure = var _max=CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
return CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Date]=_max))

vstephenmsft_0-1698732557765.png

If you also need to make up by group, for example, by month, the value of the largest day of the month should be used to fill in the previous date. You can do the following:

First create a monthyear column.

vstephenmsft_1-1698732729185.png

Then create a measure:

Measure 2 = var _max=CALCULATE(MAX('Table'[Date]),FILTER(ALLSELECTED('Table'),[MonthYear]=MAX('Table'[MonthYear])))
return CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Date]=_max))

vstephenmsft_2-1698732842579.png

 

 

Best Regards,

Stephen Tao

 

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

 

Anonymous
Not applicable

Thanks for the help.

 

I actually figured about another way to get the desired result. But your way is also working 👍

Anonymous
Not applicable

Somehow I have got the data but its not dynamic. It is showing me the max value i.e 34.34 for all my data points whereas I should show 16.70 here.

 

Any leads to resolve this?

 

Himanshu_1306_0-1698334153650.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.