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
sakarim
Frequent Visitor

Transitioning PowerBI report from tabular data to using row-level data

Hello,

 

I have recently developed and published a few Power BI reports using some of our different sources of data (here is a link to one of those dashboards for reference: here. Currently, our team is aggregating the data and setting up tables for each of the variables (i.e. age category, sex, etc.) by municipality and year. The main reason for this is due to restrictions that do not allow us to share data when counts are less than 5 (excluding 0). For example, if a municipality has 3 incidents among females in 2016, we must display "<5" rather than the true value. I currently have codes in place using tabular editor, creating calculation groups for each municipality, and formatting string expression to display the "<5" label where applicable. It works great however, we are hoping to transition the Power BI reports to read row-level data rather than setting up the aggregation tables and having to update them periodically throughout the year. My main questions are: Is it possible to use the row-level data to display counts AND percentages when counts are less than 5 as "<5"? Is it possible to recode all those values <5 as "1" (or something else) so true values aren't displayed on the actual graphs? Is it possible to display zeros when values are zero? Below is a link to a mock dashboard I created in order to get an idea of the data, coding, and set up.

 

https://www.dropbox.com/s/g6tqxnhb14a14ds/mockdashboard.pbix?dl=0 

1 REPLY 1
AlexisOlson
Super User
Super User

You could use calculation items applied to the whole report along the lines of this:

VAR Val = SELECTEDMEASURE ()
RETURN
    IF ( Val > 0 && Val < 5, 1, Val )

This should still treat zeros as zeros.

 

It's harder when you have percentages too because you need a way to distinguish which measures are which. If everything is either a count or a percentage then you could deal with it like this:

VAR Val = SELECTEDMEASURE ()
RETURN
    SWITCH (
		TRUE (),
		Val = 0, 0,
		Val < 0.05, 0.01,
		Val IN { 1, 2, 3, 4 }, 1,
		Val
	)

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.