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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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 and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors