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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
admin11
Memorable Member
Memorable Member

How to convert my expression from measure to column ? so i can use t as filter pan.

Hi All

I have a list out stand debtor :-

admin11_0-1616365977096.png

I need to filter first 2 row customer ID as high risk customer :-

 
I have below Measure , no error , but due to it is a measure , i am unable to use it as filter panel or Slicer , can some one advise how to convert to column ?
 
_HIGH_RISK_NEW_ =
SUMX (
AR, 
IF (
AR[Customer/Vendor Code] IN {"A10002","AR10012"},
0,
AR[AR_AMT_]
)
)
 
My PBI file :-
 
Paul Yeo
 
1 ACCEPTED SOLUTION

Hey @admin11 ,

 

sure, try that one:

New Column = IF( AR[Customer/Vendor Code] IN { "A10002", "AR10012" }, 0, 1 )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

11 REPLIES 11
selimovd
Super User
Super User

Hello @admin11 ,

 

the following calculated column should make it:

New Column = IF( AR[Customer/Vendor Code] IN { "A10002", "AR10012" }, 0, AR[AR_AMT_] )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

@selimovd 

 

I get error msg on below field :-

 

[Customer/Vendor Code]

 

I cannot post the image to show you the error.

Paul

@admin11 and would you also like to share the error message with me?

@admin11  

I think you added it as a measure and not as a calculated column.

Try to add it as a calculated column.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

@selimovd 

 

Yes you are correct , after i change to column , the error msg changes.

 

A circular dependency was detected: AR[Column 2], AR[_Day 1 to 31 column], AR[Column 2].

image of error msg :-

https://www.dropbox.com/s/30abga4v57ztxz0/error%20new.png?dl=0

 

 

Below is my PBI file :-

https://www.dropbox.com/s/4bqjd0kpzpt5al8/PBT_V2021_392%20TI_SI_GL%20filter%20hi%20risk%20coy%20get%...

 

Hey @admin11 ,

 

what exactly should the measure [AR_AMT_] do?

If it should return BLANK if the column AR[A/R amount include GST in LC] = 0 then try the following code for the column:

 

New Column =
VAR vAR_AMT =
    IF(
        AR[A/R amount include GST in LC] = 0,
        BLANK(),
        AR[A/R amount include GST in LC]
    )
RETURN
    IF( AR[Customer/Vendor Code] IN { "A10002", "AR10012" }, 0, vAR_AMT )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

@selimovd 

 

Thank you this time no more error , But i am not able to use it for Slicer or Fliter Pan.

 

https://www.dropbox.com/s/prvjoq2rtax07aj/CAN%20NOT%20USE%20FOR%20FILTER%20OR%20SCALIER.png?dl=0

 

Can you make it return 1 or 0 , so that i can use Slicer to filter high risj customer.

 

Paul

Hey @admin11 ,

 

sure, try that one:

New Column = IF( AR[Customer/Vendor Code] IN { "A10002", "AR10012" }, 0, 1 )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

@selimovd 

 

Finally working fine now. Thank a lot .

What are the mistake I have make in asking this question ? it is because when i post this question intially i give the expression in measure give confuse to you ? 

 

Paul

 

Hey @admin11 ,

 

I'm happy it finally worked 🙂

Yes, I think the problem was that you cannot always convert a measure to a column as the concepts are different. I think someone would have answered faster if you would have explained that you want to use that as a slicer and for that reason you have to add it as a column.

 

But eventually you got it working 🙂

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.