Forum Discussion

mrandall86's avatar
mrandall86
Frequent Visitor
2 years ago
Solved

Syntax for referencing a single item query using DAX

Hi,

I have created a single item query in Power Query:

 

I'm trying to reference it in some DAX calculations. I'd be grateful if anyone could help me get the correct syntax:

 

 

Many Thanks

 

 

  • Hi mrandall86 

    I would suggest:

    ReportDate = SELECTEDVALUE ( _ReportDate[_ReportDate] )

    This returns the single visible value in a column (if there is a single value) otherwise blank (by default).

     

    Does this work for you?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi mrandall86 ,

    I created a table myself and implemented what you showed in Power Query.

    It looks like you want to show the first row of tabular data, and you're going from Power Query to DAX. I think you can create the following Measure.

    Measure = FIRSTNONBLANK('Table'[ReportDate],1)

     

     

     

    Best Regards

    Yilong Zhou

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

4 Replies

  • Hi mrandall86 

    I would suggest:

    ReportDate = SELECTEDVALUE ( _ReportDate[_ReportDate] )

    This returns the single visible value in a column (if there is a single value) otherwise blank (by default).

     

    Does this work for you?

    • mrandall86's avatar
      mrandall86
      Frequent Visitor

      Thanks so much for taking the time! This works and I understand why, which is nice 👍

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mrandall86 ,

    I created a table myself and implemented what you showed in Power Query.

    It looks like you want to show the first row of tabular data, and you're going from Power Query to DAX. I think you can create the following Measure.

    Measure = FIRSTNONBLANK('Table'[ReportDate],1)

     

     

     

    Best Regards

    Yilong Zhou

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

    • mrandall86's avatar
      mrandall86
      Frequent Visitor

      Thanks Yilong,

       

      This works and your instructions were very easy to follow. I appreciate your time and efforts.