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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.