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, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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