Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Calculation Group format string expression mixing numbers and percentages help

The problem is that I want to get the Matrix and Table to recognise a figure as either a Number or a Percentage

in one column rather than having to see it in 2 columns.

 

For example. The matrix visualisation is currently showing:

Trend    Actual %             Target %             Actual (number)             Target (number)

barneybear123_0-1657721302097.png

 

What I would like to show on the matrix is  the following (this is a mock-up from excel)

barneybear123_1-1657721302104.png

 

The Tables show:

barneybear123_2-1657721302118.png

 

What I would like to show on the table is  the following (this is a mock-up from excel)

 

barneybear123_3-1657721302123.png

 

I do have a “tooltip matrix which is working and if I hover over the table it does show the following:

 

barneybear123_4-1657721302138.png

 

 

The Mainsheet fact table does have a column showing Number of Percentage

The matrix does use the No.s or % test Calculation Group (precedent group 2) – and  “Name” is in the column

barneybear123_12-1657723311564.png

 

 This is set as precedent group 2

Note: there is another Calculation group “Matrix (precent group is 3) but I have not used this yet

 

barneybear123_13-1657723311568.png

 

Calc Items

 

Expression

 

Format String Expression

Current                     

 

SELECTEDMEASURE()

 

Percent

CALCULATE (

    SELECTEDMEASURE (),

    FILTER (

        Mainsheet_1,

        [Number or Percentage] = "%"

    )

)

 

“0%”

Number

CALCULATE (    SELECTEDMEASURE (),    FILTER (         Mainsheet_1,        [Number or Percentage]  = "No."    ))

 

"0"

 

I think my issue is around the format string expression

 

I will try to find a way of linking the pibx as it will not work from my current work domain.



4 REPLIES 4
Anonymous
Not applicable

See main column headings from spreadsheet

KPI IndexSort OrderServiceProviderKPI SummaryNumber or PercentagePolarityDateYear & QtrActualTargetTarget Agreed
229Service "C"Provider "C"Length of Time in Treatment >26 week No. Lower is better30/06/20212021/22 Q1212626
2210Service "C"Provider "C"Length of Time in Treatment >26 week No. Lower is better30/09/20212021/22 Q2222626
2211Service "C"Provider "C"Length of Time in Treatment >26 week No. Lower is better31/12/20212021/22 Q3182626
2212Service "C"Provider "C"Length of Time in Treatment >26 week No. Lower is better31/03/20222021/22 Q4182626
289Service "C"Provider "C"Conversion Rate%Higher is better30/06/20212021/22 Q120.36%0.7575%
2810Service "C"Provider "C"Conversion Rate%Higher is better30/09/20212021/22 Q237.88%0.7575%
2811Service "C"Provider "C"Conversion Rate%Higher is better31/12/20212021/22 Q389.75%0.7575%
2812Service "C"Provider "C"Conversion Rate%Higher is better31/03/20222021/22 Q457.97%0.7575%
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

Are Act%, Tar%, Art and Tar all your columns? Why there're not Act% and Tar% in the last spreadsheet.

Best Regards,
Community Support Team _ kalyj

Anonymous
Not applicable

Hi @v-yanjiang-msft. I have now added a clearer spreadsheet and included links to dropbox excel and pibx file.

Link to excel file 

Link to PIBX 

 

The main columns are Actual and Target. In the "Matrix" the Act% Tar% Act and Tar come from the Calculation Group "No.s or % test" and I just use the "Name" in the "Column" of the visual.
I then went into format painter, into a column header and changed the font colour from black to white (so you could not see the column header colour) I then added 5 x text boxes just for visual display (Trend, Act%, Tar%, Act, Tar)barneybear123_12-1657723311564.pngText boxes.png

 

Calc Group .jpg

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.