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
nianeedpowerbi
Regular Visitor

Struggling to display the right values in power bi with calculated columns

Hello everyone,

I'm facing an issue with displaying my values in a card visual. I have a calculated column that shows the margin of the values I'm looking for. I would like to display in a card visual the sum of my margins from month to month, i.e., margin January + margin February or margin March + margin May, and so on.

To give you some context, my margin column is calculated as follows: margin 2022 vs 2021 = [gap 2022 vs gap 2021] * [CA 2022], where the column gap 2022 vs gap 2021 is defined as DIVIDE(gap 2022 - gap 2021, 100).

Following the picture below the numerical values in green correspond to my gap 2022 vs 2021, the first being for the month of May and the second for June. The ones in blue represent my margins 2022 vs 2021 for the months of May and June.

The number in gray corresponds to -266695.04 + (-11207.45): It's this number that I want to display, but Power BI is returning a different value.

 exemple.PNG

Best regards.

2 REPLIES 2
nianeedpowerbi
Regular Visitor

Hey,

 

Thanks you for your replay , 

 

I tried the time intelligence functions, but they don't work. I have an issue with my date table, but I don't know what it is since I'm a novice with it. When attempting to create quick measures with time intelligence functions, Power BI returns this error: 'Only hierarchies or date columns provided by Power BI are supported.' Another problem I'm facing is that the values retrieved by time intelligence functions are incorrect or unaffected by filters."

 

This is how i created my date table

exemple 2.PNG

 

Also i followed your link to your youtube channel where you explain tile intelligence function , very usefull but the date table seems to complex for me to understand

amitchandak
Super User
Super User

@nianeedpowerbi , Based on what I got, try using time intelligence

 

example

Sum(Table[Gap]) -  calculate(Sum(Table[Gap]), dateadd(Date[Date], -1, month) )

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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.