skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
    • Dynamics 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Overview
    • Find consulting services
    • Partner showcase
    • Find a partner
    • Become a partner
    • Instructor-led training
    • Getting started
      • Overview
      • Online workshops
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power BI Community
    • Galleries
    • Quick Measures Gallery
    • Dynamic Measures/Titles (Using Parameter Table)

    Dynamic Measures/Titles (Using Parameter Table)

    06-17-2017 02:54 AM

    rsaprano
    MVP
    15480 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    rsaprano
    rsaprano
    MVP
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Dynamic Measures/Titles (Using Parameter Table)

    ‎06-17-2017 02:54 AM

    Where you have a single numeric field (e.g. 'Value') in your table though each row represents a different measure name (and/or unit for example) then you can create a dynamic measure to be displayed in your report.

     

    You will need to create a seperate table with a single column (e.g. through 'Enter Data' in the Query Editor) containing just the unique list of measure names, and use this field as a slicer.

     

    In the example attached, there are multiple types of reading values, and each of these reading values can be expressed in one or more units of measure.  A list of unique measure names is included as a table called pMeasuresList and each of the units of measure is in a table called pUnitNames. The fields from these two single column tables are included as slicers on each page.

     

     

    The dynamic measure to then return the value of the selected measure name/unit of measure is:

     

     

    Average Measure Value =
    VAR MEASURENAME = IF(HASONEVALUE(pMeasuresList[Measure Names]),VALUES(pMeasuresList[Measure Names]),"Tidal Level")
    VAR UNITNAME = IF(HASONEVALUE(pUnitNames[unitName]),VALUES(pUnitNames[unitName]),"mAOD")
    RETURN
    CALCULATE(AVERAGE(Readings[value]),'Measures 1'[qualifier]=MEASURENAME,'Measures 1'[unitName]=UNITNAME)

     

     

    Note that this has a default value - so if the user has not made any slicer selections then it defaults to the reading "Tidal level" shown in Unit Of Measure 'mAOD'

     

    The same principle can be applied to the title, so that the report page title reflects what is being shown in the graphs:

    Title Station Analysis =

     

    VAR MEASURENAME = IF(HASONEVALUE(pMeasuresList[Measure Names]),VALUES(pMeasuresList[Measure Names]),"Tidal Level")
    VAR UNITNAME = IF(HASONEVALUE(pUnitNames[unitName]),VALUES(pUnitNames[unitName]),"mAOD")
    RETURN
    MEASURENAME & " (" & UNITNAME & ") Station Analysis"

     

    eyJrIjoiMmJlOGVkYjItMjY2OC00M2VjLTg3ZGQtNmRjNGUxNmEyNmYwIiwidCI6IjBjNzk5ZDM4LTQ3NjQtNDJiYy1iNGZmLTIzYmViYTljN2ZlMiIsImMiOjh9

    Preview file
    25 KB
    EnvAgency Dashboard New Design v2.pbix
    Labels:
    • Labels:
    • Filters
    • Other
    Message 1 of 4
    15,480 Views
    5
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    snandy2011
    snandy2011 Helper IV
    Helper IV
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎07-06-2018 11:24 PM

    Hi Rishi Sir,

     

    I have only one words for you.. That is "Superb". No words after that. This is the real example of playing with visualization and DAX. I just started my Data Analyst career. Working in Power Bi since 2 months. This .pbix file is my inspiration and dream, that one day, i will be able to make this kind of visualization. I have learnt Power Bi from youtube, google and some blogs.So, your .pbix file will help me to learn more. Thanks a lot sir, for sharing this awesome creation with us. It will be a new milestone for newcommer like me.I have one question for you, hope you dont mind to answer this, how much experiences you have taken to achieve this level?

    Thank one again sir and if you have any tips and advice for newbie like me, then please share.

     

    Sincerely,

    Sayam

     

    Message 4 of 4
    13,082 Views
    1
    Reply
    KailasSwami698
    KailasSwami698
    New Member
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-20-2018 08:18 PM

    Hi,

    could ypu please tell me from where should i get current year example rain data and Historic flood warnings data?

     

    Thanks,

    Kailas S.

    Message 2 of 4
    13,609 Views
    0
    Reply
    rsaprano
    rsaprano
    MVP
    In response to KailasSwami698
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-30-2018 01:50 AM

    Hi

     

    The Environment Agency data I used is available at http://environment.data.gov.uk/flood-monitoring/archive - this contains data both as CSVs and an API call

     

    Thanks

     

    Rishi

     

     

    Message 3 of 4
    13,556 Views
    0
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices