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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Youri98
Helper I
Helper I

Date +1 day to get data to show in different month

Hi!

 

I'm trying to add 1 day to a date because the data (for example) shows in January but I would like it to show in February. The case is: a contract ends at 1 date and the new contract starts at a new date. Problem is: when filtering to the data I would like to show, I can only get the ending date. In most cases this is at the end of the month, for example 31-01-2025, so in the report it obviously shows up in January. I would like it to show in February, that's why I would like to add 1 day. The date column is a integer '20250131'. So I need to convert it to date with DAX + I need filters to get the specific data out. 

 

This is one of the things that I tried:

 

Contracts =
CALCULATE(
DISTINCTCOUNT('FACT_Contract'[%ContractKey]),
'FACT_Contract'[VALUE] = 1.00,
'FACT_Contract'[Subject] IN { "Days" },
DATE(
DIVIDE(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 
DIVIDE(MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 100), 
MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 100) 
)
)

 

This is the error that I'm getting: "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column."

 

Converting the date in a single measure works, filtering the data to get what I need works in a single measure. But combining both doesn't work.

 

I'm not sure if it's even possible to do what I want. If anyone has an idea, please let me know.

 

Thanks in advance!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Youri98 Convert the integer date to a date format and add one day:

DAX
ConvertedDate =
DATE(
DIVIDE(SELECTEDVALUE('FACT_Contract'[DATE]), 10000),
DIVIDE(MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 100),
MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 100)
) + 1

 

Use this new date in your calculations and filters:

DAX
Contracts =
CALCULATE(
DISTINCTCOUNT('FACT_Contract'[%ContractKey]),
'FACT_Contract'[VALUE] = 1.00,
'FACT_Contract'[Subject] IN { "Days" },
DATE(
DIVIDE(SELECTEDVALUE('FACT_Contract'[DATE]), 10000),
DIVIDE(MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 100),
MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 100)
) + 1
)




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

2 REPLIES 2
bhanu_gautam
Super User
Super User

@Youri98 Convert the integer date to a date format and add one day:

DAX
ConvertedDate =
DATE(
DIVIDE(SELECTEDVALUE('FACT_Contract'[DATE]), 10000),
DIVIDE(MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 100),
MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 100)
) + 1

 

Use this new date in your calculations and filters:

DAX
Contracts =
CALCULATE(
DISTINCTCOUNT('FACT_Contract'[%ContractKey]),
'FACT_Contract'[VALUE] = 1.00,
'FACT_Contract'[Subject] IN { "Days" },
DATE(
DIVIDE(SELECTEDVALUE('FACT_Contract'[DATE]), 10000),
DIVIDE(MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 10000), 100),
MOD(SELECTEDVALUE('FACT_Contract'[DATE]), 100)
) + 1
)




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

Proud to be a Super User!




LinkedIn






I accidently clicked 'Accept as solution' without trying so far. I need to replace the date stuff in the 2nd DAX with the ConvertedDate right?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.