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
Anonymous
Not applicable

Power BI How to avoid sum of created measure

I have a database contains "Company Names","Purchase Order","Payment Amount". data preview image is below

Data PreviewData Preview

I try to create matrix table with columns;

Company name: Returns company names, that' s OK

Hk: at how many times I have pay that company, at this point i have a problem

SUM_Payment: sums all payments, that' s ok, see matrix table image below;

pci2.png

 

I tried to create measure that gives to Hk Sum false for avoding summing (like HASONEVALUE), but B Company has two value so B Company's Hk returns also false...

 

My expectation from matrix table is "Not to see sum of Hk" . How can I avoid summing Hk ?

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Try with ISFILTERED:

 

Hk =
IF(
    ISFILTERED( Hakedis_Data[Company_name] ),
    MAX( Hakedis_Data[Purchase Order] ),
    BLANK()
)

 

Regards 

View solution in original post

2 REPLIES 2
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Try with ISFILTERED:

 

Hk =
IF(
    ISFILTERED( Hakedis_Data[Company_name] ),
    MAX( Hakedis_Data[Purchase Order] ),
    BLANK()
)

 

Regards 

amitchandak
Super User
Super User

@Anonymous , use isinscope or isfiltered and try

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

if(isinscope(Table[Company Name]), [HK], blank())

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.