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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AshDil
Helper V
Helper V

Want to count the ID having measure calculation greater than 100%

Hi,

I have data as follows:

IDCATEGORYSUB-CATEGORYSALESTARGET
1AAA100150
2BBB200200
3CCC300200
4AAB400300
5BBC500400
6CCA100150
7ACC200150
8BBB300300
9CAA400500

I need to count the ID having Divide(Sales,Target) > 100%, in above case the count is 4.

Please help me to do it.

Thanks,

AshDil.

1 ACCEPTED SOLUTION

Maybe something like this?

 

SUMX (
    VALUES ( dimID[ID] ),
    IF (
        CALCULATE ( SUM ( Sales[Sales ) ) > CALCULATE ( SUM ( Target[Target] ) ),
        1
    )
)

 

It's hard to say exactly without seeing your model.

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Hello Dear,

If the data is the same as you uploaded it, you must occupy this DAX

Divide = 
COUNTROWS(
    FILTER('Table (3)',
    ( 'Table (3)'[Ventas] / 'Table (3)'[Blanco] ) > 1   )
)

AlexisOlson
Super User
Super User

How about counting rows where Sales > Target?

COUNTROWS ( FILTER ( Table1, Table1[Sales] > Table[Target] ) )

 

Hi @AlexisOlson & @Syndicate_Admin ,

 

If Sales & Target present in different fact tables then how to do it. The both fact tables are connected to calendar table and common column between two fact tables is ID.

Please help me to do it.

Thanks,

AshDil.

Maybe something like this?

 

SUMX (
    VALUES ( dimID[ID] ),
    IF (
        CALCULATE ( SUM ( Sales[Sales ) ) > CALCULATE ( SUM ( Target[Target] ) ),
        1
    )
)

 

It's hard to say exactly without seeing your model.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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