Forum Discussion

ivath0's avatar
ivath0
Frequent Visitor
5 years ago
Solved

Quick Measure Error Message

How do I correct this error?

 

OutFlow YTD =

IF(ISFILTERED('Cap'[ "Date"]),

    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),

    TOTALYTD([OutFlow], 'Cap'[ "Date"].[Date])

  • ivath0 also if it still doesn't work, share PBIX with sample date thru one drive/google drive. Remove any sensitive information before sharing.

9 Replies

  • ivath0 you should add a date dimension in your model, check this post on how to add one.

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

     

     

     

    • ivath0's avatar
      ivath0
      Frequent Visitor

      I've copied your code but I get the following error message:

      The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. What have i missed?

  • ivath0 also if it still doesn't work, share PBIX with sample date thru one drive/google drive. Remove any sensitive information before sharing.

    • ivath0's avatar
      ivath0
      Frequent Visitor

      The code I'm trying is copied from your post, referred to in a previous reply

  • ivath0 can you please paste the code here...I don't which code you are trying or referring to?

  • Hi ivath0 

    Having created the Date Table you need to tell PBI to use it as the Date Table for the model/calculations.

    In the Data view you should have a table like this

     

    Right click on it and click Mark as date table -> Mark as date table

    Regards

    Phil

  • ivath0 are you still getting the error with the code and in my blog post, it also mentioned that date table should be marked as a date table as mentioned by PhilipTreacy . 

     

    Also, did you changed the measure? It should use Date from new data table.

     

    IF(ISFILTERED('Date Table'[Date]),
    
        ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    
        TOTALYTD([OutFlow], 'Date Table'[Date])

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.