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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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