cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmiraBedh
Super User
Super User

Best practice when creating a measure

I have a measure I use in an clustered column chart, the syntax is below :

CalculateTickets = COUNT(FactTable[TicketSK])

In the chart I added the Status as an axis and I want to add a card for the total of each status

What is the best approach between :

- Use the same measure and apply a filter on the card based on the Status dimension

-Create a new measure like below :

CalculateTickets Test=
CALCULATE ([CalculateTickets], DimStatus[StatusLabel] ="On Hold")

 

What is the best approach and why ?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AmiraBedh , Having 1 or 2-level measure looping is fine ( measure used inside measure)

 

But you need sure about the difference between

CalculateTickets Test=
CALCULATE ([CalculateTickets], DimStatus[StatusLabel] ="On Hold")

 

and

 

CalculateTickets Test=
CALCULATE ([CalculateTickets], Filter(DimStatus, DimStatus[StatusLabel] ="On Hold"))

 

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@AmiraBedh , Having 1 or 2-level measure looping is fine ( measure used inside measure)

 

But you need sure about the difference between

CalculateTickets Test=
CALCULATE ([CalculateTickets], DimStatus[StatusLabel] ="On Hold")

 

and

 

CalculateTickets Test=
CALCULATE ([CalculateTickets], Filter(DimStatus, DimStatus[StatusLabel] ="On Hold"))

 

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.