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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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

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])))

 

 

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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