Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi,
I have information such as
Group Name Column A Column B Quarter
ABC 100 200 2020Q1
ABC 200 300 2020Q2
DEF 100 200 2020Q1
DEF 100 600 2020Q2
I want my slicer on Column B with just one quarter selection which means
if the slicer is set as 301, the flag should set as 0
I have built my slicer on Column A which is on 2020Q2 - 2020Q1 so it gives out 100
Basically, my data should look like
Group Name Column A Column B
ABC 100 300
DEF 0 600
& in slicer on Column B is set as >300 there should be just DEF 0 600 displayed.
Solved! Go to Solution.
Hi @Anonymous ,
Create a measure as below and add it to visual filter.
Measure =
var _previous = CALCULATE(SUM('Table'[Column A]),FILTER(ALL('Table'),'Table'[Group]=SELECTEDVALUE('Table'[Group])&&RIGHT('Table'[Quarter],1)+0=RIGHT(SELECTEDVALUE('Table'[Quarter]),1)-1))
var _subtraction = IF(ISBLANK(_previous),BLANK(),SELECTEDVALUE('Table'[Column A])-_previous)
var _max = CALCULATE(MAX('Table'[Column B]),ALLEXCEPT('Table','Table'[Group]))
return
IF(_subtraction>SELECTEDVALUE(slicer1[slicer1])&&_max>SELECTEDVALUE(slicer2[slicer2]),1,0)
Best Regards,
Jay
Hi @Anonymous ,
Create a measure as below and add it to visual filter.
Measure =
var _previous = CALCULATE(SUM('Table'[Column A]),FILTER(ALL('Table'),'Table'[Group]=SELECTEDVALUE('Table'[Group])&&RIGHT('Table'[Quarter],1)+0=RIGHT(SELECTEDVALUE('Table'[Quarter]),1)-1))
var _subtraction = IF(ISBLANK(_previous),BLANK(),SELECTEDVALUE('Table'[Column A])-_previous)
var _max = CALCULATE(MAX('Table'[Column B]),ALLEXCEPT('Table','Table'[Group]))
return
IF(_subtraction>SELECTEDVALUE(slicer1[slicer1])&&_max>SELECTEDVALUE(slicer2[slicer2]),1,0)
Best Regards,
Jay
@Anonymous , need a little bit more clarity on what you need, getting lost into the description
I have two files. One for 2020 Q1 and one for 2020 Q2.
First file has records:
Group Name Column A Column B Quarter
ABC 100 200 2020Q1
ABC 200 300 2020Q2
Second file has records:
DEF 100 200 2020Q1
DEF 100 600 2020Q2
When i combine both the files, the data looks like
Group Name Column A Column B Quarter
ABC 100 200 2020Q1
ABC 200 300 2020Q2
DEF 100 200 2020Q1
DEF 100 600 2020Q2
Now i want two slicers on this.
First slicer on Column A which is based on group name and subtraction of the previous quarter from second quarter
Second slicer on Column B which is grouped by group name and just simply takes the max quarter value, in this case it is 2020 Q2 which is 300.
So the values for group ABC
looks like
ABC (200-100) 300
DEF (100-100) 600
So if i select slicer 1 as > 99 and slicer 2 as > 299, i only see one row which is
ABC 100 300
I have done the first part is on Slicer 1. For slicer 2 , i tried restricting the data to only quarter 2 on the entire page, however then the calculations go wrong for slicer 1 since first quarter data is not available.
Check out the November 2023 Power BI update to learn about new features.