The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello community, I am doing a comparison of expenses of a workshop with equal matrices, for each matrix there is a
filter to be able to determine the periods to compare
I would like to know how I can visually make if a field increases against the other period an up arrow appears and if
it decreases it puts an arrow down
Something like a stock market type
Solved! Go to Solution.
Hi @LuisRode ,
Here are the steps you can follow:
1. Create measure.
Flag1value =
var _min=MINX(ALLSELECTED(Date1),'Date1'[Date])
var _max=MAXX(ALLSELECTED(Date1),'Date1'[Date])
var _groupsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Group]=MAX('Table'[Group])&&'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
var _allsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
return
DIVIDE(_groupsum,_allsum)
Flag2value =
var _min=MINX(ALLSELECTED(Date2),'Date2'[Date])
var _max=MAXX(ALLSELECTED(Date2),'Date2'[Date])
var _groupsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Group]=MAX('Table'[Group])&&'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
var _allsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
return
DIVIDE(_groupsum,_allsum)
Value1 =
var _min=MINX(ALLSELECTED(Date1),'Date1'[Date])
var _max=MAXX(ALLSELECTED(Date1),'Date1'[Date])
return
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max&&'Table'[Group]=MAX('Table'[Group])),[Value])
Value2 =
var _min=MINX(ALLSELECTED(Date2),'Date2'[Date])
var _max=MAXX(ALLSELECTED(Date2),'Date2'[Date])
return
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max&&'Table'[Group]=MAX('Table'[Group])),[Value])
Measure =
SWITCH(
TRUE(),
[Flag1value]>[Flag2value],UNICHAR ( 11014 ),
[Flag1value]<[Flag2value],UNICHAR ( 11015 ),
"="
)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @LuisRode ,
Here are the steps you can follow:
1. Create measure.
Flag1value =
var _min=MINX(ALLSELECTED(Date1),'Date1'[Date])
var _max=MAXX(ALLSELECTED(Date1),'Date1'[Date])
var _groupsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Group]=MAX('Table'[Group])&&'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
var _allsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
return
DIVIDE(_groupsum,_allsum)
Flag2value =
var _min=MINX(ALLSELECTED(Date2),'Date2'[Date])
var _max=MAXX(ALLSELECTED(Date2),'Date2'[Date])
var _groupsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Group]=MAX('Table'[Group])&&'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
var _allsum=
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max),[Value])
return
DIVIDE(_groupsum,_allsum)
Value1 =
var _min=MINX(ALLSELECTED(Date1),'Date1'[Date])
var _max=MAXX(ALLSELECTED(Date1),'Date1'[Date])
return
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max&&'Table'[Group]=MAX('Table'[Group])),[Value])
Value2 =
var _min=MINX(ALLSELECTED(Date2),'Date2'[Date])
var _max=MAXX(ALLSELECTED(Date2),'Date2'[Date])
return
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[Date]>=_min&&'Table'[Date]<=_max&&'Table'[Group]=MAX('Table'[Group])),[Value])
Measure =
SWITCH(
TRUE(),
[Flag1value]>[Flag2value],UNICHAR ( 11014 ),
[Flag1value]<[Flag2value],UNICHAR ( 11015 ),
"="
)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for your answer, I already made each date filter independent for each display table
But I still can't achieve what I want, I'm looking for the image that I share to be able to compare between the two months and see which one has gone up and which one has gone down
@LuisRode, You need Independent/ disconnected tables for have second slicer, refer this, create two measures and have a diff
How to use two Date/Period slicers: https://youtu.be/WSeZr_-MiTg