- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dynamic title using calculation group
Hi Folks.
using the awesome Tabular Editor, I created a calculation group to format values in $ or Hours depending the selectedvalue of a drop down. That works fine with my values. The problem is the title of my visual is also dynamic ("Project Hours" or "Project $"), but as soon as I introduce the value formating in the visual, my title turns into an ugly "$#,##0" or "#,##0h" instead of the string expression. I tried to avoid the formating of the text measure following the Great Marco Russo's article here, with selectedvalueformatstring() expression, but then the title just doesn't show up at all... 😞
Any idea on how to bypass the formatting for dynamic text measures?
Thx a lot,
Ben
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @BenCardineau -
Are you trying to use a Measure to define the Title Text? If so, when you define the text string measure, you need to exclude it from your Calculation Group rules. I think you need to add a ISSELECTEDMEASURE() condition to your calculation groups so it focus on the Metric Measures only, and ignores String Measures.
For example:
Metric Measure = SUM ( [Amount] )
Text Measure = IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) = "Dollar" , "Project $", "Project Hours")
In the calculation group expression, the following is required.
IF ( NOT( ISSELECTEDMEASURE( [Mertric Measure] ) ), SELECTEDMEASURE() , IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) , Use Dollars , Use Hours ) )
In the Expression Format, the following is added.
IF ( NOT( ISSELECTEDMEASURE( [Mertric Measure] ) ), "" , IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) , Use Dollars format , Use Hours format ) )
I hope this helps you find the right solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ben,
I am facing a similar problem, did the solution work for you? Or how did you fix this? 🙂
Hope you can help, as i am really stuck here 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Daryl-Lynch-Bzy thx for your inputs! Yes, that's in essence what I had done... I replicated it in a brand new file (with exact same code as in the initial file), where it worked ok. After scratching my head around this for some time, I believe it's due to the fact that my initial file has RLS, and some roles in RLS do filter the 'Selection' field ("hours" or "$")... Do that make sense to you, that RLS may affect like this, even in desktop?
Anyway, thx again for your help!!
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @BenCardineau -
Are you trying to use a Measure to define the Title Text? If so, when you define the text string measure, you need to exclude it from your Calculation Group rules. I think you need to add a ISSELECTEDMEASURE() condition to your calculation groups so it focus on the Metric Measures only, and ignores String Measures.
For example:
Metric Measure = SUM ( [Amount] )
Text Measure = IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) = "Dollar" , "Project $", "Project Hours")
In the calculation group expression, the following is required.
IF ( NOT( ISSELECTEDMEASURE( [Mertric Measure] ) ), SELECTEDMEASURE() , IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) , Use Dollars , Use Hours ) )
In the Expression Format, the following is added.
IF ( NOT( ISSELECTEDMEASURE( [Mertric Measure] ) ), "" , IF ( SELECTEDVALUE ( [Project Type] , "Hours" ) , Use Dollars format , Use Hours format ) )
I hope this helps you find the right solution.
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - January 2025
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
Subject | Author | Posted | |
---|---|---|---|
03-03-2023 05:46 AM | |||
Anonymous
| 10-19-2018 04:58 AM | ||
07-23-2024 06:34 AM | |||
02-15-2023 08:08 AM | |||
Anonymous
| 01-13-2023 04:46 AM |
User | Count |
---|---|
13 | |
12 | |
11 | |
7 | |
7 |
User | Count |
---|---|
16 | |
13 | |
11 | |
11 | |
9 |