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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TWijnen
Frequent Visitor

DAX measures on axes question

Hi, can someone please help with the following case?

 

I would like to use measures on axes, or maybe there is another way. See attached image.

TWijnen_0-1674750074149.png

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @TWijnen 

 

You can try the following methods.
Column:

Sum input = CALCULATE(SUM('Table'[input]),ALLEXCEPT('Table','Table'[day]))
Sum onput = CALCULATE(SUM('Table'[output]),ALLEXCEPT('Table','Table'[day]))
Category = SWITCH(TRUE(),
[Sum input]>[Sum onput],"more input",
[Sum input]<[Sum onput],"more onput",
[Sum input]=[Sum onput],"equal")
Count days = CALCULATE(DISTINCTCOUNT('Table'[day]),ALLEXCEPT('Table','Table'[Category]))

vzhangti_0-1675063280853.png

vzhangti_1-1675063301768.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
TWijnen
Frequent Visitor

Hi @v-zhangti 

 

Thanks for your reply. I still need to try it out on my dataset, the example I gave is very simplified compared to my real world scenario.

I see you used calculated columns, that is really helpful to me, for some reason I was thinking I could only solve this using measures.

I will reply later with my findings.

 

I dont understand why this post/question was marked as solved when I have not replied yet.

 

v-zhangti
Community Support
Community Support

Hi, @TWijnen 

 

You can try the following methods.
Column:

Sum input = CALCULATE(SUM('Table'[input]),ALLEXCEPT('Table','Table'[day]))
Sum onput = CALCULATE(SUM('Table'[output]),ALLEXCEPT('Table','Table'[day]))
Category = SWITCH(TRUE(),
[Sum input]>[Sum onput],"more input",
[Sum input]<[Sum onput],"more onput",
[Sum input]=[Sum onput],"equal")
Count days = CALCULATE(DISTINCTCOUNT('Table'[day]),ALLEXCEPT('Table','Table'[Category]))

vzhangti_0-1675063280853.png

vzhangti_1-1675063301768.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

TWijnen
Frequent Visitor

You mean for the logic in the "category measure"? I don't think that will work because at raw data row level there will be different outcomes of the "category measure" vs the outcomes on agreggated level. Check the data.

 

Agree? Or did you mean something else?

wdx223_Daniel
Super User
Super User

you need add a calculated column in your source data

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors