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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.