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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
krichmond
Helper IV
Helper IV

Need help enhancing DAX to include an "After Today" logic statement.

Details are provided below as to what we currently have in place. What I need to do is enhance the "Actual Prmeium With Time Designator" field so that if the date is in the future "Today + 1 Day" it pulls from a field called "Projected Premium". The "Projected Premium" field sits in a table called "mv_perfex".

 

I have a working column called "90 Day Date Designator" with the following formula:

IF(DATEDIFF(mv_perfex[startdate],TODAY(),DAY)>0&&DATEDIFF(mv_perfex[startdate],TODAY(),DAY)<=90,"True","False")

 

I have another working column called "180 Day Date Designator" with the following formula:
IF(DATEDIFF(mv_perfex[startdate],TODAY(),DAY)>90&&DATEDIFF(mv_perfex[startdate],TODAY(),DAY)<=180,"True","False")
 
I than have a field called "Actual Premium With Time Designator" that leverages these two other fields. This field has the following formula:
SWITCH(TRUE(),
[90 Day Date Designator]="True",[Projected Average Buy]*[Projected Paid Responders],
[180 Day Date Designator]="True",mv_perfex[Prem @100%],
[180 Day Date Designator]="False",mv_perfex[Act_Prem])
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@krichmond , Based on what I got. A new column

 

SWITCH(TRUE(),

mv_perfex[startdate] > today() , [Projected Premium]
[90 Day Date Designator]="True",[Projected Average Buy]*[Projected Paid Responders],
[180 Day Date Designator]="True",mv_perfex[Prem @100%],
[180 Day Date Designator]="False",mv_perfex[Act_Prem])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @krichmond ,

 

Here I suggest you to try this measure.

Actual Premium With Time Designator =
VAR _DATEDIFF =
    DATEDIFF ( mv_perfex[startdate], TODAY (), DAY )
RETURN
    SWITCH (
        TRUE (),
        _DATEDIFF = 1, [Projected Premium],
        _DATEDIFF > 1
            && _DATEDIFF <= 90, [Projected Average Buy] * [Projected Paid Responders],
        _DATEDIFF > 90
            && _DATEDIFF <= 180, mv_perfex[Prem @100%],
        mv_perfex[Act_Prem]
    )

 

Best Regards,
Rico Zhou

 

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

amitchandak
Super User
Super User

@krichmond , Based on what I got. A new column

 

SWITCH(TRUE(),

mv_perfex[startdate] > today() , [Projected Premium]
[90 Day Date Designator]="True",[Projected Average Buy]*[Projected Paid Responders],
[180 Day Date Designator]="True",mv_perfex[Prem @100%],
[180 Day Date Designator]="False",mv_perfex[Act_Prem])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.