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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
tkavitha911
Helper III
Helper III

Hi Team, Pls help this dax calculated table im getting error

ADDCOLUMNS(
    SUMMARIZE(
        'Daily Inventory',
        'Daily Inventory'[Country New name]
    ),
    "ThisThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR ThisThursdayDate = TodayDate + (5 - WEEKDAY(TodayDate, 2))
RETURN ThisThursdayDate
)
),
 "LastThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR LastThursdayDate = TodayDate - WEEKDAY(TodayDate, 2) - 2
RETURN LastThursdayDate
),
 "Difference", [ThisThursdayNetInventory] - [LastThursdayNetInventory]
)
)
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@tkavitha911 , Try using

DAX
ADDCOLUMNS(
SUMMARIZE(
'Daily Inventory',
'Daily Inventory'[Country New name]
),
"ThisThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR ThisThursdayDate = TodayDate + (5 - WEEKDAY(TodayDate, 2))
RETURN ThisThursdayDate
)
),
"LastThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR LastThursdayDate = TodayDate - WEEKDAY(TodayDate, 2) - 2
RETURN LastThursdayDate
)
),
"Difference", [ThisThursdayNetInventory] - [LastThursdayNetInventory]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

5 REPLIES 5
v-tsaipranay
Community Support
Community Support

Hi @tkavitha911 ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-tsaipranay
Community Support
Community Support

Hi @tkavitha911 ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-tsaipranay
Community Support
Community Support

Hi @tkavitha911 

Thank you for reaching out to the Microsoft fabric community forum. Also thank you @bhanu_gautam  for providing solution.

 

To assist you better, could you please clarify what you're trying to achieve with this calculated table? Specifically, are you looking to compare net inventory values for this Thursday versus last Thursday by country and location?

Also, are [ThisThursdayNetInventory] and [LastThursdayNetInventory] defined measures, or are you trying to calculate them within this expression? Lastly, please share the exact error message you're encountering. This will help us provide more accurate guidance.

 

Thank you.

Hi @tkavitha911 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

bhanu_gautam
Super User
Super User

@tkavitha911 , Try using

DAX
ADDCOLUMNS(
SUMMARIZE(
'Daily Inventory',
'Daily Inventory'[Country New name]
),
"ThisThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR ThisThursdayDate = TodayDate + (5 - WEEKDAY(TodayDate, 2))
RETURN ThisThursdayDate
)
),
"LastThursdayNetInventory", CALCULATE(
[Net Inventory mUSD],
FILTER(
ALLEXCEPT('Daily Inventory', 'Daily Inventory'[Country New name], 'Daily Inventory'[Location_c], 'Daily Inventory'[Type]),
'Daily Inventory'[Date] =
VAR TodayDate = TODAY()
VAR LastThursdayDate = TodayDate - WEEKDAY(TodayDate, 2) - 2
RETURN LastThursdayDate
)
),
"Difference", [ThisThursdayNetInventory] - [LastThursdayNetInventory]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.