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
Anonymous
Not applicable

Measure to get plan for every day

My goal is create a measure that gets a plan value for every dayfrom my calendar.

I have 2 tables - calendar and plans, then I create relationship on columns Date -> Plan from date. But when I try to create a "Visual I want" showing on my screenshot, I get what I get (4th table).

I tried to use option Show items with no data and create my own measure but I was failed to get a correct result. Your help is very appreciated.

blaster_2-1673818029088.png

 

 

 

1 ACCEPTED SOLUTION

hi @Anonymous 

You may write a measure like this:

 

measure = 
VAR _date = SELECTEDVALUE(CalendarTable[Date]) 
RETURN
MINX(
    FILTER(
        ALL(PlansTable),
        PlansTable[Plan from date]<=_date
            &&PlansTable[Plan to date]>=_date
    ),
    PlansTable[Value]
)

 

it worked like this:

FreemanZ_0-1673856015647.png

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello @Anonymous this is easily solved in power query

 

Go to transform data, select your table

Add a new column with the below formula

{Number.From([plan from date])..Number.From([plan to date])}

 

Then on the new column expand to new rows and change type to date

 

If you dont have a "until date" column then just add an index column then add a new column

 

Type in : Try [plan from date] {[Index] + 1} otherwise null

 

Then just create a new column again 

 

{Number.From([plan from date])..Number.From(Date.AddDays([new column],-1))}

Anonymous
Not applicable

HI eliasayy,

I have date 9999-12-31 for active plans and a lot of products that have it plan target (I just did not mention it in my example for simplicity) and some plans started from 2017 year.

I have around 100к rows in my PlansTable now and if I create additional rows for every day it will crete me a huge table.

Is there any chans to do that with a measure only?

hi @Anonymous 

You may write a measure like this:

 

measure = 
VAR _date = SELECTEDVALUE(CalendarTable[Date]) 
RETURN
MINX(
    FILTER(
        ALL(PlansTable),
        PlansTable[Plan from date]<=_date
            &&PlansTable[Plan to date]>=_date
    ),
    PlansTable[Value]
)

 

it worked like this:

FreemanZ_0-1673856015647.png

 

 

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.