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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JordanJackson
Advocate II
Advocate II

DAX measure giving the wrong answer / different answer when in a table compared to a bar chart

I've written to following DAX measure to calculate the current energy system type from different sites:

Latest System Types Countx (4) =
CALCULATE(
    COUNTX('Sites_Energy_and_Water', 'Sites_Energy_and_Water'[Type of System]),
    FILTER(
        'Sites_Energy_and_Water',
        'Sites_Energy_and_Water'[DateofRecording] = MAX('Sites_Energy_and_Water'[DateofRecording])
    )
)
 
I've tried with just COUNT and then COUNTX in order to resolve the issue. When I place this measure into a bar visual it only given me 5 results:
JordanJackson_0-1682680407114.png

But in the data source and when the measure is in a table it shows that there are 7 entries when following the slicers, yet the total is wrong on here also.

JordanJackson_1-1682680539611.png

 


I am aware that this would be something to do with the way that total values are calculated but I was under the impression that COUNTX would then resolve this issue?

Any help with this would be greatly appreciated!

2 REPLIES 2
siddhesh_mane
New Member

Hi @JordanJackson 

 

Is it possible to provide a sample dataset for this?

 

Thank you,

Siddhesh H Mane.

System Type Measure Region Contract Satalite Name
Generator + Battery 1 E A  
Generator + Battery 1 E A 2
Generator + Battery 1 E B 1
Generator + Battery + Solar 1 E B 2
Generator + Battery + Solar 1 E C 1
Generator + Battery + Solar 1 E D 1
Hydrogen + Battery 1 E E 1


Am I needing to add in the Satalite Name context to the measure?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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