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
Lucian
Responsive Resident
Responsive Resident

Variable measure name... or a workaround?

Hello,

 

I have a table similar to this one

 

DataTable.jpg

 

I need a comparison table with 2 columns based on Year column, using two slicers for years.

 

So, I've created 2 tables for each slicer based on the year column using this thread: Re: Two slicer on same column

 

FilterTBL-Base = DISTINCT('DataTable'[Year])
FilterTBL-CompareTo = DISTINCT('DataTable'[Year])

And for each "filter table" the corresponding measure to know the selected value:

 

SelectedYear-Base = SELECTEDVALUE('FilterTBL-Base'[Year])

and

SelectedYear-CompareTo = SELECTEDVALUE('FilterTBL-CompareTo'[Year])

Now I could calculate the "base total" and the "total to compare to" in my data table:

 

TotalBase = SUMX(FILTER('DataTable','DataTable'[Year]=[SelectedYear-Base]),'DataTable'[Cost])

and

 

TotalCompareTo = SUMX(FILTER('DataTable','DataTable'[Year]=[SelectedYear-CompareTo]),'DataTable'[Cost])

So the entire structure looks like this:

 

FieldsStructure.jpg

 

The calculation works as expected:

 

ResultTable.jpg

 

The only problem it bothers me, is that the final table should have the column names based on the slicer selections. In picture above TotalBase should display "FY_2010" and the TotalCompareTo should display "FY_2011".

 

Is there a way to achieve this? I'm open to any sugestion even if requires R/Python visual.

 

Kind Regards,

Lucian

1 ACCEPTED SOLUTION

Hi @v-xuding-msft 

 

Thank you for your time, unfortunately the two matrix will be far away from the requirement as the separate matrix will break the ideea of "comparison" as posted in my previous picture.

If you look to your last posted picture will see that the second matrix will not "align" the values for the same project because are not available (C2 for projects A&C).

 

The only "closest workaround" was two card visuals with same font/size as the rest of the column titles, but loosing any sort option or "focus mode" for that visual.

 

Meanwhyle, anyone that will need "dynamic column naming" could vote for this ideea: Improved table visual - dynamic column names  

 

Kind Regards,

Lucian

View solution in original post

6 REPLIES 6
v-xuding-msft
Community Support
Community Support

Hi @Lucian ,

If you want to use table visual, I'm affraid it couldn't be implemented. You could chang TABLE visual to MATRIX visual and drag the "Year" column to Columns field to be shown as column name. 

However, there is a little flaw in this way. If you want to drag more than one value to Value field, it will show the value name and the column name at the same time. When you drag one value, it will just show column name.

Two valuesTwo valuesOne valueOne value

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

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

Hello @v-xuding-msft

 

And thank you for your time. Indeed, matrix could be an option, unfortunately did not cover the report design requirements.

The final report should look like this:

 

 

FinalReport.jpg

Any other workaround?

 

Kind Regards,

Lucian

Hi @Lucian ,

I'm afraid there is not a perfect method to show the two column names dynamically in the same visual.  You could try to create two matrix to show them separately as a workaround. In this way, they will be changed correctly.

3.PNG

I attached my sample that you can have a try.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

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

Hi @v-xuding-msft 

 

Thank you for your time, unfortunately the two matrix will be far away from the requirement as the separate matrix will break the ideea of "comparison" as posted in my previous picture.

If you look to your last posted picture will see that the second matrix will not "align" the values for the same project because are not available (C2 for projects A&C).

 

The only "closest workaround" was two card visuals with same font/size as the rest of the column titles, but loosing any sort option or "focus mode" for that visual.

 

Meanwhyle, anyone that will need "dynamic column naming" could vote for this ideea: Improved table visual - dynamic column names  

 

Kind Regards,

Lucian

Hi @Lucian ,

It's regrettable that your requirement can't be implemented. I voted up the idea. You could accept your answer as a solution. Then others who need the requirement will find your answer quickly and vote up it as well. 

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

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

Hello @v-xuding-msft 

 

Thank you again for your time and sugestions, and also for your vote. Maybe will raise enough votes for implementation. Smiley Very Happy

 

Kind Regards,

Lucian

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.