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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Comparing Values based on two different times

HI All, 

 

I have a to compare some data based on the selection of the date where the data were created. 

 

Table: 

FC on FC for Value
01.05.2021 01.02.2022 100
01.06.2021 01.02.2022 99
01.06.2021 01.03.2022 150
01.07.2021 01.02.2022 105
01.07.2021 01.03.2022 85

 

I'm trying to compare the values in two selected "FC on"

 

e.g. I've selected via Slicer "FC on" 01.06.2021 and 01.07.2021

 

Desired result is: 

FC for 01.06.2021 01.07.2021 Delta
01.02.2022 99 105 6
01.03.2022 150 85 -65

 

All Data are in one table, didanybody had this problem and might share some hints or a solution to the problem? 

 

Thank you in advance!  

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you I've adjusted it a bit and placed in in one measure 🙂 works fine! 

FC Delta = 
    VAR _MAX = MAXX(ALLSELECTED(Table),Table[FC on])
    VAR _MIN = MINX(ALLSELECTED(Table),Table[FC on])
    VAR MinDate = CALCULATE(sum(Table[Value]),FILTER(Table,Table[FC on] = _MIN))
    VAR MaxDate = CALCULATE(sum(Table[Value]),FILTER(Table,Table[FC on] = _MAX))
    VAR FCDelta = MaxDate - MinDate
    return
    FCDelta

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can create three measures and use

 

Min date =
var _max = maxx(allselected(Table),Table[FC on])
var _min = maxx(allselected(Table),Table[FC on])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[FC on] =_min ))

Max date =
var _max = maxx(allselected(Table),Table[FC on])
var _min = maxx(allselected(Table),Table[FC on])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[FC on] =_max ))


Diff =
divide([Max date] - [Min date], [Min date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you I've adjusted it a bit and placed in in one measure 🙂 works fine! 

FC Delta = 
    VAR _MAX = MAXX(ALLSELECTED(Table),Table[FC on])
    VAR _MIN = MINX(ALLSELECTED(Table),Table[FC on])
    VAR MinDate = CALCULATE(sum(Table[Value]),FILTER(Table,Table[FC on] = _MIN))
    VAR MaxDate = CALCULATE(sum(Table[Value]),FILTER(Table,Table[FC on] = _MAX))
    VAR FCDelta = MaxDate - MinDate
    return
    FCDelta

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.