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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

DAX

Hello guys, hope you're all doing well.

I didn't find any answers to my question so I'm asking it to you. Maybe you'll help me to solve this "issue".

 

I have this graph I made, showing the delta of prices bewteen 2 databases. In fact, I want to display, using a card, the number of points being negative or positive (not interested in knowing how many are accounting for a delta of 0).

I tried using DAX but I can't even formulate including my "Delta" as it's already a measure I made.

Here is a screenshoot of the graph.

Chocapic4S_0-1707492619042.png

 

Any advice on this point ?

 

Thanks in advance for your help 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Now that you have created a measure for deltas, you can use the existing measure to create another measure to calculate positive and negative deltas. You can try following these steps:

1. You need to create a new measure.

 

MEASURE = 
VAR _1 =
    CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Price] > 0 ) )
VAR _2 =
    CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Price] < 0 ) )
RETURN
    IF ( SELECTEDVALUE ( 'Table (2)'[Selected] ) = "+", _1, _2 )

 


Final output:

vyifanwmsft_0-1709184749450.png

vyifanwmsft_1-1709184769567.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

Now that you have created a measure for deltas, you can use the existing measure to create another measure to calculate positive and negative deltas. You can try following these steps:

1. You need to create a new measure.

 

MEASURE = 
VAR _1 =
    CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Price] > 0 ) )
VAR _2 =
    CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Price] < 0 ) )
RETURN
    IF ( SELECTEDVALUE ( 'Table (2)'[Selected] ) = "+", _1, _2 )

 


Final output:

vyifanwmsft_0-1709184749450.png

vyifanwmsft_1-1709184769567.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hello! thanks for your message.

Unfortunately, it's not working but I'm trying to find another way to display these information.

 

Thank you for your help!

 

Ritaf1983
Super User
Super User

Hi @Anonymous 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

Hello, sorry. 

This is an idea of how I would like my card to look like. Basically counting the number of negatives or positive points on my graph.

Chocapic4S_0-1707494899792.png

 

Thank you!

@Anonymous 

assuming

your delta measure =    delta_m

 

now the requirement is that you want to count the nb of negative or positive ( let u stick to pos in this exmaple ) 

 

 

 

your new measure = 

 

var ds = 

countx(

filter(

addcolumns( 

values(tbl_name[col_name]) ,

"@delta " , [delta_m]

) , 

[@delta] > 0 
),

tbl_name[col_name]

)

 

 

this should work . 

 

 

nb: replce tbl_name[col_name] with the groupby column you are calculating your deltas based on .

 

ex : 

you want nb of post delta grouped by customer name ; 

then  tbl_name[col_name] ===  dimcustomer[customr_name]

 

hope this make sense. 

 

 

 

If this helped you solved your question ,  mark it as the solution so can you can help other people in the community find it easily .

 

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!

December 2024

A Year in Review - December 2024

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