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
ramkula123
Helper I
Helper I

DAX calculation

Hi All, 

 

I need to calculate the difference (in weeks) between weekdays i.e today and weekday (ex : 201920). I have values like 201919,201920,201921 etc in column A in my table .

The expected result is ,if Column A has value 201921 then result should be -1 as we are 201922 week currently .

 

Thank you.

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi @ramkula123 ,

 

You can try to create column like DAX below.

 

Column1= VALUE(MID(Table1[Column A],5,2))-WEEKNUM(TODAY())

 

Best Regards,

Amy

 

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

 

@v-xicai Thanks for inputs ! 🙂 

But I have older weeks as well in my column A . I have values like 201821, 201822 etc .

Hence I need to calculate the difference in weeks from 2017 ,2018 to current week. 

Hi @ramkula123 ,

 

Yes, I know your demand. Did the DAX formula fail to meet your demand? Or could you please share your sample data or desired output screenshots for further analysis?

 

Best Regards,

Amy

Hi @v-xicai 



Please find the screenshot . I have put 3 columns : Input data , Result expected , The result which I am getting using the formula above .

 

PBI community.PNG

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