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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DataSkills
Resolver I
Resolver I

Bizarre behaviour when adding a measure to a table

Hi, this one has got me!

 

I have a standard table, showing Patient.Name, Level and then a calculation of hours based on this level (x3). 

DataSkills_0-1718192117895.png

 

DataSkills_2-1718192941473.png

 

I created a measure called Total care mins = sum(PatientAttribute[Level])*3

 

My total time in hours calc is simply: 

Total Care Hours = [Total care mins]/60
 
But the format is not great to show time, so I tried this:
Total Care Hours = Convert([Total care mins]/1440, DATETIME)
 
Unfortunatley, if hours is over 24, it doesn't show more than 24 hours. ie 27 hours and 14 minutes would show as 3:14.  Which is clearly no good. 
 
So, I tried this:
Total care hours = 
Var hrs = [Total care mins]/60
Return
int(hrs) & ":" &  format(round(mod(hrs, 1)*60, 0), "00")
 
The moment I do this, the whole table shows a bunch of extra rows of data where it appears as if some kind of union has happened. I change the formula to:
Total care hours = 
Var hrs = [Total care mins]/60
Return
hrs
All is fine again.  I am at a loss to explain why this would be the case.  The ONLY change I can see happening is that the format of the measure automatically changes from General to Text. But this is still confusing to me as to why it would show this. 
DataSkills_3-1718193716692.png

 

becomes...

 

DataSkills_4-1718193823534.png
 
I've checked my model. I have one to many relationships between all tables. 
 
I've tried this and still get the weird behaviour:
Total care hours = 1
Any pointers would be gratefully accepted.
1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

It's weird if you don't know what's happening but not weird if you do.  Powerbi visuals are very sensitive to the measures that are in those visuals. The visuals show combinations of data in the rows for which a measure has a value.  If the measure value is blank, the row is not displayed.<- (this is important)

When you create a measure, for example, measureA = 1, and put that in a visual, you will see all combinations of data which produce a non-blank value in the measure.  In this case, the measure is always 1 so you get to see all combinations i.e. lots of rows.

Now that doesn't really get you any closer to solving your original problem but that's why multiple rows are appearing in the visual.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

It's weird if you don't know what's happening but not weird if you do.  Powerbi visuals are very sensitive to the measures that are in those visuals. The visuals show combinations of data in the rows for which a measure has a value.  If the measure value is blank, the row is not displayed.<- (this is important)

When you create a measure, for example, measureA = 1, and put that in a visual, you will see all combinations of data which produce a non-blank value in the measure.  In this case, the measure is always 1 so you get to see all combinations i.e. lots of rows.

Now that doesn't really get you any closer to solving your original problem but that's why multiple rows are appearing in the visual.

@HotChilli YES! You are 100% right! With your help, I modified my formula as follows:

var hrs = [Total care mins]/60
Return
if(ISBLANK(hrs), blank(),
int(hrs) & ":" &  format(round(mod(hrs, 1)*60, 0), "00"))
 
FIXED! Legend! Thank you. 

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.