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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Why am I unable to use CALCULATE(), LOOKUPVALUE() functions?

Hi Experts,

 

I am wondering why am I unable to use CALCULATE(), LOOKUPVALUE() functions while creating new columns?

I am working on a pbix file that sources the data from Power BI dataset and Dataflows.

 

When I test the same functions on pbix file that sources data from Excel source, they do work.

 

Are these functions restricted based on the datasource?

 

My appologies for my ignorance and it might be very basic question.

 

Appreciate your inputs.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous,

Did you work on live mode? AFAIK, they limit the Dax functions usages to create calculate column/table. You can try to use the following formula to create a measure if helps:

Next Day =
VAR currDate =
    MAX ( DispenseTable[Date] )
RETURN
    CALCULATE (
        MIN ( DispenseTable[Date] ),
        FILTER ( DispenseTable, DispenseTable[Date] > currDate ),
        VALUES ( DispenseTable[PatientId] ),
        VALUES ( DispenseTable[MP] )
    )

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Dataset in live mode, you can not create new column.

dataset in direct query mode, you can only do limited operations.

 

Dataflow has the limitation of the direct query if you are doing direct query of dataflow 

 

Power BI Decoding Direct Query: https://www.youtube.com/playlist?list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA

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

Thanks @amitchandak 

 

I am trying to achieve below but I get the message saying the CALCULATE is not a function.

Is there a way I can achieve below?

 

Next Day = CALCULATE(MIN(DispenseTable[Date]),FILTER(DispenseTable,DispenseTable[PatientId]=EARLIER(DispenseTable[PatientId])&&DispenseTable[MP]=EARLIER(DispenseTable[MP])&&DispenseTable[Date]>EARLIER(DispenseTable[Date])))

 

 

Anonymous
Not applicable

HI @Anonymous,

Did you work on live mode? AFAIK, they limit the Dax functions usages to create calculate column/table. You can try to use the following formula to create a measure if helps:

Next Day =
VAR currDate =
    MAX ( DispenseTable[Date] )
RETURN
    CALCULATE (
        MIN ( DispenseTable[Date] ),
        FILTER ( DispenseTable, DispenseTable[Date] > currDate ),
        VALUES ( DispenseTable[PatientId] ),
        VALUES ( DispenseTable[MP] )
    )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors