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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
krzysztof
Helper III
Helper III

DAX - one of the categories is to be counted differently


Please help.
I want to set the values ​​in the table for the category, but one of the categories should show the data in a different way.

1.PNG

 

 

2.PNG

 

 

 

https://drive.google.com/open?id=1nAzp2nEidn85rzOzDEEwKGGDJcrZiObX

1 ACCEPTED SOLUTION

@krzysztof 

 

Sorry I was away.

 

Do you mean correct Total?

 

In that case, you add a new MEASURE referencing previous measure

Please see your amended fiel attached

 

Measure 2 =
IF (
    HASONEFILTER ( 'Table'[Category] ),
    [Measure],
    SUMX ( VALUES ( 'Table'[Category] ), [Measure] )
)

ky.png

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@krzysztof 

 

You can use this MEASURE

 

Measure =
VAR maxmonth =
    MAX ( 'Table'[Month] )
RETURN
    IF (
        SELECTEDVALUE ( 'Table'[Category] ) = "AU",
        CALCULATE ( SUM ( 'Table'[value] ), 'Table'[Month] = maxmonth ),
        SUM ( 'Table'[value] )
    )

 

@Zubair_Muhammad I hope you understand me 🙂

@krzysztof 

 

Sorry I was away.

 

Do you mean correct Total?

 

In that case, you add a new MEASURE referencing previous measure

Please see your amended fiel attached

 

Measure 2 =
IF (
    HASONEFILTER ( 'Table'[Category] ),
    [Measure],
    SUMX ( VALUES ( 'Table'[Category] ), [Measure] )
)

ky.png

thank you. And how to have all categories in the table plus categories with your calculations?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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