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

How to get current week till yesterday Value in stacked Column chart

Hello,
How to get current week till yesterday Value in stacked Column chart.

For eg- If today is Wedeneaday and in graph the value should display till Tuesday and again the if today is thursday then value should displat till Wednesday like till saturday we want, currently we manually doing this how can do it by Using DAX.

Belwo is the sample data 

hb0135_0-1763349364586.png

Sr NoREPORTDATEREPORTYEARWEEKDayMonth NameDay NoREPORTQTY
106-11-20252545ThuNovember419
206-11-20252545ThuNovember45
305-11-20252545WedNovember322
405-11-20252545WedNovember332
605-11-20252545WedNovember323
705-11-20252545WedNovember39
805-11-20252545WedNovember322
905-11-20252545WedNovember345
1012-11-20252546WedNovember371
1112-11-20252546WedNovember334
1214-11-20252546FriNovember52
1314-11-20252546FriNovember521
1506-11-20252545ThuNovember412
1710-11-20252546MonNovember127
1811-11-20252546TueNovember214
2207-11-20252545FriNovember54
2307-11-20252545FriNovember50
2407-11-20252545FriNovember51
2508-11-20252545SatNovember67
2608-11-20252545SatNovember60
2708-11-20252545SatNovember621
3715-11-20252546SatNovember621
3815-11-20252546SatNovember66
3905-11-20252545WedNovember315
4013-11-20252546ThuNovember455
4113-11-20252546ThuNovember457
4313-11-20252546ThuNovember431
4413-11-20252546ThuNovember41
4530-10-20252544ThuOctober46
9829-10-20252544WedOctober319
10030-10-20252544ThuOctober437
10531-10-20252544FriOctober59
1 ACCEPTED SOLUTION

pls update the expected output or the sample data and make them are matching. Then that will be helpfule for us to figure out the logics and double check if the solution is correct or not.





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

Proud to be a Super User!




View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar question in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@hb0135 

is the screenshot the expected output?

It looks like the data in the chart does not match the sample data you provided.

Could you pls clarify this?





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

Proud to be a Super User!




Hello,
Screenshot is the expected output required for me, the data which is shown is the sample data like this we have data format

Hello @hb0135 ,

 

Thank you @Ashish_Mathur and @ryan_mayu  for sharing your response!


Just checking has your concern been resolved? If the provided answer helped, please confirm so others can benefit from the solution too.


Thank you for your cooperation!

Hi @hb0135 ,

 

I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

Thank you.

pls update the expected output or the sample data and make them are matching. Then that will be helpfule for us to figure out the logics and double check if the solution is correct or not.





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

Proud to be a Super User!




Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

One of ways is to have Calendar Dimension table, and then try to filter the calendar table inside CALCULATE function in the measure.

 

Jihwan_Kim_1-1763350982404.png

 

 

Jihwan_Kim_0-1763350948311.png

 

 

Expected result: = 
VAR _today =
    DATE ( 2025, 11, 13 ) // assume today is 20251113, in a real DAX measure, insert the dax function TODAY()
VAR _daynumber =
    WEEKDAY ( _today, 2 )
RETURN
    CALCULATE (
        SUM ( Data[REPORTQTY] ),
        KEEPFILTERS (
            FILTER (
                ALL ( 'Calendar' ),
                'Calendar'[REPORTDATE] <= _today && 'Calendar'[Day No] <= _daynumber
            )
        )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
alish_b
Impactful Individual
Impactful Individual

Hey @hb0135 ,

Please try the method provided by @Jihwan_Kim. Just a thing I wanted add was, from my understanding, you want just the data from the current week. In that case, you can introduce a week filter in the FILTER expression. In case you would like a reusable script to construct a date table, please refer to a script provided by RADACAD: https://radacad.com/download/15507/?tmstv=1763353612.
You will need to make some changes in the script for start and end of the date range.

Let us know if you encounter any issues.
Hope it helps!

PijushRoy
Super User
Super User

Hi @hb0135 

Assume you want to show data for the last 7 days, except today
The following may help you achieve this.

PijushRoy_0-1763350246260.png

 







Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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.