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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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