Forum Discussion

saipawar's avatar
saipawar
Icon for Helper IV rankHelper IV
6 years ago
Solved

How to retrieve single value from a table

Hi,

I have the following table -

 

MetricFY20Q3FY20Q2
Page Visits2500700
Unique Visitors700200
Visits1200150

 

I am creating a KPI card for which I need to query to retrieve results only specific to FY20Q2. Ultimately, I'll need 3 new measures namely - 

1. Last qtr page visits 

2. Last qtr Unique Visitors

3. Last qtr Visits.

 

In SQL, I would have queried something like this - 

Last qtr page visits  = SELECT FY20Q2 FROM tablename WHEN tablename.metric=Page Visits

 

Please help me with the query in Power BI.

 

Thanks

  • saipawar the measure will look like this

     

    Last qtr page visits = 
    CALCULATE ( MAX ( Table[FY20Q2] ), Table[Metric] = "Page Visits" )

     

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

1 Reply

  • saipawar the measure will look like this

     

    Last qtr page visits = 
    CALCULATE ( MAX ( Table[FY20Q2] ), Table[Metric] = "Page Visits" )

     

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