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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
o59393
Post Prodigy
Post Prodigy

Divide Count ifs equivalent to dax

Hi all

 

How could I get a dax measure like the one below I did in excel?

 

o59393_0-1707975475961.png

 

Here is the table:

 

TopicImpact%
ABCHigh75.00%
ABCHigh75.00%
ABCHigh75.00%
ABCMedium25.00%
TestLow25.00%
TestHigh25.00%
TestMedium50.00%
TestMedium50.00%

 

I tried something like this but it's not working

 

o59393_1-1707975786587.png

 

 

 

Count Ifs = 

DIVIDE(
    CALCULATE(
        COUNTROWS('Heatmap'),
        FILTER(
            'Heatmap',
            'Heatmap'[Risk] = EARLIER('Heatmap'[Risk]) && 'Heatmap'[Risk] = EARLIER('Heatmap'[Risk])
        )
    ),
    CALCULATE(
        COUNTROWS('Heatmap'),
        FILTER(
            'Heatmap',
            'Heatmap'[Risk] = EARLIER(Heatmap'[Risk])
        )
    )
)

 

 

Please click on the image to see bigger.

 

Thanks.

6 REPLIES 6
ThxAlot
Super User
Super User

 

PCT = 
CALCULATE( COUNTROWS( Data ) )
    / CALCULATE( COUNTROWS( Data ), ALLEXCEPT( Data, Data[Topic] ) )

ThxAlot_0-1707985009068.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Hi @ThxAlot 

 

I used the dax in the real dataset and got 25% each:

 

o59393_1-1708014050569.png

 

What should happen is: 50%, 25%, 25%, 50%

 

50% meaning 2 rows out of 4 rows are High

1 out of 4 rows is low

1 out of 4 rows is blank

 

How can I fix it?


Thanks.

 

Jihwan_Kim
Super User
Super User

Hi, 

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1707977100831.png

 

 

Expected result CC =
VAR _topic =
    COUNTROWS ( FILTER ( Data, Data[Topic] = EARLIER ( Data[Topic] ) ) )
VAR _impact =
    COUNTROWS (
        FILTER (
            Data,
            Data[Topic] = EARLIER ( Data[Topic] )
                && Data[Impact] = EARLIER ( Data[Impact] )
        )
    )
RETURN
    DIVIDE ( _impact, _topic )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

I am getting this error highlighted in red:

o59393_0-1708013778221.png

 

Any idea why?


Thanks.

 

Hi, 

is this written for a measure or a calculated column?

My sample solution is, as mentioned above, for calculated column.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

Should be a measure. 

 

Thanks!

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors