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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rpinxt
Impactful Individual
Impactful Individual

Need a "flag" that I can control with a slicer

I have this matrix:

rpinxt_0-1667486012985.png

Now what I am trying to achieve is make some sort of flag that marks activity in the last 3 years and is not blocked.

 

So I already have fields that determine if blocked and > 3 years.

I now want to look at the total and if that is greater than 0 there is activity so it will be a "yes" and else "no".

With the other 2 flags I can then do the rest (older then 3 years and not blocked).

 

I made this measure but cannot use it in the matrix layout and also not in a slicer 😞

Activity = (IF([Amount] < 0,"No","Yes"))
 
And amount is : 
Amount = SUM('Vendor Activity'[AMT LC])
 
Can somebody put me in the correct direction?
Looked into making a calculated column but then I can get per vendor 2 lines because of minus rows (credits)
(maybe that can be fixes with ABS) as there are several line per vendor of course and he should look to the total per vendor.
 
**EDIT** :
No don't think I can use calculated columns.
There are 2 tables. A master data for vendor and a table for vendor with the amounts.
So the lines that are blank are vendors in our master data but there was never any activity on it in the amounts table.
1 ACCEPTED SOLUTION
rpinxt
Impactful Individual
Impactful Individual

Found it 😄

With help of some earlier post I was able to rebuild it so it would work for me.

Will list my solution here for others to find if they are facing similar problems.

 

I made a measure status like:

Status = IF(ISBLANK([Amount]) || [Amount]=0,"Not Active","Active")
 
(So if amount is 0 or Blank it is not active otherwise active)
 
Then I made a calculated column like :
Status =
var x1=SUMMARIZE('Vendor Master','Vendor Master'[VendorMs],"Status",[Status])
return
SUMMARIZE(x1,[Status])
 
Here the VendorMs is my vendor field for which I want to check if amount is 0 or blank.
[Status] is the measure I just created.
 
Then the field Status from the calculated table Status you can put in your slicer.
 
Last thing you need to do then is make a filter value you can put in the filters pane of your visual to make the slicer work.
 
I made this measure filter:
Measure_filter =
var x1=SELECTEDVALUE('Status'[Status])
return
IF(ISBLANK(x1),1,IF([Status]=x1,1,0))
 
Then you put this in your filter pane and set it to 1
rpinxt_0-1667548594355.png

 

Now my slicer works fine on lines with data, for zeros and lines that are blank 😁

rpinxt_1-1667548720444.pngrpinxt_2-1667548739983.png

 

View solution in original post

2 REPLIES 2
rpinxt
Impactful Individual
Impactful Individual

Found it 😄

With help of some earlier post I was able to rebuild it so it would work for me.

Will list my solution here for others to find if they are facing similar problems.

 

I made a measure status like:

Status = IF(ISBLANK([Amount]) || [Amount]=0,"Not Active","Active")
 
(So if amount is 0 or Blank it is not active otherwise active)
 
Then I made a calculated column like :
Status =
var x1=SUMMARIZE('Vendor Master','Vendor Master'[VendorMs],"Status",[Status])
return
SUMMARIZE(x1,[Status])
 
Here the VendorMs is my vendor field for which I want to check if amount is 0 or blank.
[Status] is the measure I just created.
 
Then the field Status from the calculated table Status you can put in your slicer.
 
Last thing you need to do then is make a filter value you can put in the filters pane of your visual to make the slicer work.
 
I made this measure filter:
Measure_filter =
var x1=SELECTEDVALUE('Status'[Status])
return
IF(ISBLANK(x1),1,IF([Status]=x1,1,0))
 
Then you put this in your filter pane and set it to 1
rpinxt_0-1667548594355.png

 

Now my slicer works fine on lines with data, for zeros and lines that are blank 😁

rpinxt_1-1667548720444.pngrpinxt_2-1667548739983.png

 

rpinxt
Impactful Individual
Impactful Individual

Ok...so harder then I thought....

 

Is there then maybe some other way of giving the user an option to see only the lines where there are no amounts?

 

I know I can just go into the filter pane and switch on the "is blank" under the values field.

But for my end users this is no ideal solution. I would like a bit more intuitive option for them.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.