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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MaPBIAch2010
Frequent Visitor

Minus 1 day in edate measure

Hi all,

I found for my case the half way to complete solution, but now now I'm stuck.

I have below information, but on the end I need a solution, that the edate is minus 1 day.
This is my information Visual, it contain follow measures:

MaPBIAch2010_0-1695288776160.png

Runtime mth = (sum(Activities[Project_Runtime])*12)
 
SOP sdate = FIRSTDATE(Activities[SOP_Year])
 
SOP edate = IF((EDATE((MAX(Activities[SOP_Year])),[Runtime mth])) = Date(1900,12,31),"",(EDATE((MAX(Activities[SOP_Year])),[Runtime mth])))
 
The calculation by above measures look in the table correct.
But when I use below measure
 
Potential Sum per mth = SUMX(VALUES('Calendar'[YYYY-MM]), CALCULATE(SUMX(FILTER(Companies, Companies[SOP sdate] <= max('Calendar'[Date]) && Companies[SOP edate] >= MIN ('Calendar'[Date])), DIVIDE(Activities[Potential total SOP LC], DATEDIFF(Companies[SOP sdate], Companies[SOP edate],MONTH)))))
 
The Matrix visuel show the 5.000,00 to much in 2029 and the total is 365.000,00
MaPBIAch2010_1-1695289353016.png

I tried to subtract a day from the edate (-1 day), but can't get it to work.

Can someone help with me?

Thank u in advance!

KR

Maha

 
1 ACCEPTED SOLUTION
MaPBIAch2010
Frequent Visitor

Hi all,

I found for my case the half way to complete solution, but now now I'm stuck.

I have below information, but on the end I need a solution, that the edate is minus 1 day.
This is my information Visual, it contain follow measures:

MaPBIAch2010_0-1695361959432.png

 

Runtime mth = (sum(Activities[Project_Runtime])*12)
 
SOP sdate = FIRSTDATE(Activities[SOP_Year])
 
SOP edate = IF((EDATE((MAX(Activities[SOP_Year])),[Runtime mth])) = Date(1900,12,31),"",(EDATE((MAX(Activities[SOP_Year])),[Runtime mth])))
 
The calculation by above measures look in the table correct.
But when I use below measure
 
Potential Sum per mth = SUMX(VALUES('Calendar'[YYYY-MM]), CALCULATE(SUMX(FILTER(Companies, Companies[SOP sdate] <= max('Calendar'[Date]) && Companies[SOP edate] >= MIN ('Calendar'[Date])), DIVIDE(Activities[Potential total SOP LC], DATEDIFF(Companies[SOP sdate], Companies[SOP edate],MONTH)))))
 
The Matrix visuel show the 5.000,00 to much in 2029 and the total is 365.000,00
MaPBIAch2010_1-1695361959437.png

 

I tried to subtract a day from the edate (-1 day), but can't get it to work.

Can someone help with me?

Thank u in advance!

KR

Maha

View solution in original post

1 REPLY 1
MaPBIAch2010
Frequent Visitor

Hi all,

I found for my case the half way to complete solution, but now now I'm stuck.

I have below information, but on the end I need a solution, that the edate is minus 1 day.
This is my information Visual, it contain follow measures:

MaPBIAch2010_0-1695361959432.png

 

Runtime mth = (sum(Activities[Project_Runtime])*12)
 
SOP sdate = FIRSTDATE(Activities[SOP_Year])
 
SOP edate = IF((EDATE((MAX(Activities[SOP_Year])),[Runtime mth])) = Date(1900,12,31),"",(EDATE((MAX(Activities[SOP_Year])),[Runtime mth])))
 
The calculation by above measures look in the table correct.
But when I use below measure
 
Potential Sum per mth = SUMX(VALUES('Calendar'[YYYY-MM]), CALCULATE(SUMX(FILTER(Companies, Companies[SOP sdate] <= max('Calendar'[Date]) && Companies[SOP edate] >= MIN ('Calendar'[Date])), DIVIDE(Activities[Potential total SOP LC], DATEDIFF(Companies[SOP sdate], Companies[SOP edate],MONTH)))))
 
The Matrix visuel show the 5.000,00 to much in 2029 and the total is 365.000,00
MaPBIAch2010_1-1695361959437.png

 

I tried to subtract a day from the edate (-1 day), but can't get it to work.

Can someone help with me?

Thank u in advance!

KR

Maha

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors