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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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