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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.