cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
channah Frequent Visitor
Frequent Visitor

show negative numbers as a positive

I have data that I am showing both issues when numbers are over a certain threshhold - to correct those issues but I also want to show when the numbers are below the value and are able to handle more in those classes  - so i can show when a class is in violation and when it is not but keeping them separate so I can use conditional formating to distinguish it  - I could just use the same column and create a background conditional format to show negative and positive but I cannot create the negative numbers

 

Class total

Total composition factor (max 3)

Max size based on comp factor

Excess of size

Excess of composition

 

26

5

26

0

2

 

27

5

26

1

2

 

24

3

26

0

0

Would like a column that says 2 spaces available for size and 0 for composition

25

2

26

0

0

Would like it to say 1 space for size and one for composition in a separate column

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: show negative numbers as a positive

Hi @channah ,

 

I assume that the table you show is the data as you have setup on your model correct?

 

I create the two following measures:

 

Excess/Space for composition = SUM(Composition[Total Compositon factor]) - 3 

Excess/Space for size = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])

Now you can use the condittional formatting option on your table.

composition.png

 

Not really sure if your question was that you couldn't create the negatives or you didn't want to create the negatives.

 

If you want to show 4 columns you must do the 4 measures below:

 

Excess compostion = var composition_size = SUM(Composition[Total Compositon factor]) - 3 
Return
IF(composition_size>0; ABS(composition_size);0)

Excess size = var size_variation = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])
return
IF(size_variation >0 ; ABS(size_variation);0)


Space compostion = var composition_size = SUM(Composition[Total Compositon factor]) - 3 
Return
IF(composition_size<0; ABS(composition_size);0)


space size = var size_variation = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])
return
IF(size_variation <0 ; ABS(size_variation);0)

See attach PBIX file.

 

Regards,

MFelix

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: show negative numbers as a positive

Hi @channah ,

 

I assume that the table you show is the data as you have setup on your model correct?

 

I create the two following measures:

 

Excess/Space for composition = SUM(Composition[Total Compositon factor]) - 3 

Excess/Space for size = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])

Now you can use the condittional formatting option on your table.

composition.png

 

Not really sure if your question was that you couldn't create the negatives or you didn't want to create the negatives.

 

If you want to show 4 columns you must do the 4 measures below:

 

Excess compostion = var composition_size = SUM(Composition[Total Compositon factor]) - 3 
Return
IF(composition_size>0; ABS(composition_size);0)

Excess size = var size_variation = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])
return
IF(size_variation >0 ; ABS(size_variation);0)


Space compostion = var composition_size = SUM(Composition[Total Compositon factor]) - 3 
Return
IF(composition_size<0; ABS(composition_size);0)


space size = var size_variation = SUM(Composition[Class Total])- SUM(Composition[Max sized compositoon])
return
IF(size_variation <0 ; ABS(size_variation);0)

See attach PBIX file.

 

Regards,

MFelix

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

channah Frequent Visitor
Frequent Visitor

Re: show negative numbers as a positive

Thanks - yes basically i want to show and then use conditional formatting to make it noticeable, that if there is no issue with class size or composition - how many spaces are available - right now if there are no issues it shows a 0 - I wouldnt mind making 4 columns since newby users are using the tool and we want to be able to see what classrooms have space at a quick glance 

 

channah Frequent Visitor
Frequent Visitor

Re: show negative numbers as a positive

however when I use the measures and add them to my visual - all of the students who have a 0 their data all disappears ???

 

channah Frequent Visitor
Frequent Visitor

Re: show negative numbers as a positive

i already have the size and composition measures 

Students in excess of class size (S1) = if([MStudentCount]-[MMaxSize]<0,0, [MStudentCount]-[MMaxSize])
this determines that based on type of special needs student the class size varies, 1 or 2 Compositon Violation, 1 less student 2 or more composition violation student, 2 less students in class
 
Students in excess of compositon (S2) = IF(COUNTROWS(VALUES(TblDemo[Teacher_name]))=1,IF([McompositionViolation NC]>3,[McompositionViolation NC]-3,0))
the composition is max 3, else in violation
 
do I still need to recreate the excess composition and size measures - or can i use these to create the space size?
Super User
Super User

Re: show negative numbers as a positive

Hi @channah,

You don't need to recreate the excess since you already have them, just create the space measures.

Regards,
MFelix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 88 members 1,288 guests
Please welcome our newest community members: