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
Asaezmata
New Member

Display measure name based on selected (date slicer) validity dates

Hi guys!

I have a card that should display the name of a measure based on the selected dates and their respective validity ranges (see images for reference). the MeasureNames and the Locations data is located in Sharepoint lists; while the date table was created directly in power BI using:

         date = CALENDAR(DATE(2019 , 1 , 1), date( year(TODAY()), MONTH(TODAY()), DAY(TODAY())))

 

Locations list has the following structure (simplified):

 

 

 

 Locations.JPG

 

 

MeasureNames list has the following structure (simplified):

 

 

MeasureNames.JPG

dates table has the following structure:

 

 

Dates.JPG

 

The idea is to have the names displayed depending on the selected range (date slicer). There are 2 possibilities:

  • If the Site, the name, or the selected range is not included on the MeasureNames list, then it should display a default name (e.g. if the user selects date from 01/Jan/2017 to 01/Feb/2017, then the displayed name should be "default)
  • If one of the dates selected by the user is included on the MeasureNames list, then it should display the latest name (e.g. if the user selects for the Site MX1 the date range from 01/Feb/2019 to 22/May/2019, then the displayed name should be Eaches IB)

Do you have any ideas as to how to accomplish this? Any ideas are greatly appreciated!

 

have a great day!

 

Alejandro

 

 

2 REPLIES 2
santiagomur
Resolver II
Resolver II

Try

measure=
SELECTEDVALUE('TABLE'[NAME];"DEFAULT")

Hi Santiago!
 
thanks for your reply.
 
the problem I am facing with the solution you suggested is that the values might be duplicated; i which case, it should show the latest value within the range:
Measure=
CALCULATE(
   SELECTEDVALUE(Table[Name],
        CALCULATE(
            LASTNONBLANK( Table[Name],1),
            FILTER(Table,
                   Table[DateFrom] <= [MINDATE] || Table[DateTo] >= [MAXDATE])
           
                )
   )
 
Currently, I can´t make PBI filter the table only for the values within the range
Any suggestions?

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.