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
Arunsaikiran
Regular Visitor

Get to display Text values from a column in table using another column value from the same Table.

Hi guys

1. I have created a measure which changes upon selecting a city name in slicer.

city_filt = CALCULATE(min('city-slicer (2)'[city_name]),ALLSELECTED('city-slicer (2)'))
2. I have created another measure which uses this measure 'city_filt' to give the maximum revenue based on our selection in slicer.
max_rev_month = CALCULATE(MAX(revenue[plan_revenue]),FILTER(dim_cities,dim_cities[city_name]=[city_filt]))
3. Now I am trying to display the date corresponding to this measure 'max_rev_month'  and the selected city 'city_filt' which is in the same table.
I tried
max_month =
CALCULATE(min(plan_revenue[date]),
FILTER(plan_revenue,
plan_revenue[plan_revenue] = [max_rev_month]),
FILTER(fact_plan_revenue,
plan_revenue[city_code] = [city_filt]
))
I am getting the minimum date but not the exact date matching these two measures ([max_rev_month],[city_filt]). Please guide me in this
3 REPLIES 3
Arunsaikiran
Regular Visitor

Arunsaikiran_2-1670586536690.png                                                    Arunsaikiran_1-1670586443142.png

From the above table I am trying to get the date of the row where value in plan_revenue matches

with the the selected value from the city_name.

My expected output is the date where plan_revenue value = value from measure max_rev_month 

                                               

 

v-jialluo-msft
Community Support
Community Support

Hi  @Arunsaikiran ,

 

You can try this:

max_rev_month = CALCULATE(MAX(revenue[plan_revenue]),FILTER(ALL(dim_cities),dim_cities[city_name]=[city_filt]))

max_month =
CALCULATE(min(plan_revenue[date]),
FILTER(ALL(plan_revenue),
plan_revenue[plan_revenue] = [max_rev_month]),
FILTER(ALL(fact_plan_revenue),
plan_revenue[city_code] = [city_filt]
))

If that's not what you need, provide sample files and expected output.

 

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

 

FreemanZ
Super User
Super User

would be good to provide some sample data.

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.

Top Solution Authors