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
Bessonnizza
Helper II
Helper II

Boolean calculations measure

Hi, all.

 

Have table with the following columns:

Date - CompanyID - Licenses

 

Have measures:

SumLicense = SUMX('Billing';'Billing'[Licenses])
SumLicensePreviousWeek = CALCULATE(SUMX('Billing';'Billing'[Licenses]);DATEADD('Calendar'[Date];-7;DAY))
Difference = SumLicense-SumLicensePreviousWeek

Need to calculate Total Difference is less than 0 and Total Difference is greater than 0 for current Year and visualize it for card or pie chart.

 

For example i can add measures for table and add filters less/greater than 0 and get calculations that i needed in string "Total".

Screenshot_3.png4.png

Аnyone have ideas how i can visualize it for card or pie chart?

 

Thanks in advance.

1 ACCEPTED SOLUTION

@Bessonnizza add following two measures and use these in pie chart. hope it helps.

 

Would appreciate Kudos 🙂 if my solution helped.

 

Measure above zero = 
SUMX ( 
VALUES ( Table[CompanyId] ), 
IF ( [Difference] > 0, [Difference] )
)

Measure below zero = 
SUMX ( 
VALUES ( Table[CompanyId] ), 
IF ( [Difference] < 0, [Difference] )
)

  



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@Bessonnizza you cannot change th visual of table visual to pie chart and I believe it should work. If you already tried it and then what didn't woked in pie chart, please explain.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

 Hi, @parry2k

 

I'm sorry, i'm not correctly at all. Yes, it works, but pie chart must include two values:
1) SUM [Difference] with condition [Difference]>0
2) |SUM [Difference]| with condition [Difference]<0

 

Need value which circled red.

Screenshot_2.png

I have troubles with measure which calculate SUM [Difference] with condition [Difference]>0 or <0. 

 

@Bessonnizza add following two measures and use these in pie chart. hope it helps.

 

Would appreciate Kudos 🙂 if my solution helped.

 

Measure above zero = 
SUMX ( 
VALUES ( Table[CompanyId] ), 
IF ( [Difference] > 0, [Difference] )
)

Measure below zero = 
SUMX ( 
VALUES ( Table[CompanyId] ), 
IF ( [Difference] < 0, [Difference] )
)

  



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k ty!

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.