Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a problem and I am seeking for help, I have an issue with a DAX formula.
First of all let me explain my requirment, I have 2 tables one in direct query and the other in import mode
The first table is called TibcoIncident which is for outage affected substations data and the other table is called Medical Case which will have all the customers that is registered that Have a critical medical devices, now I want for every record to come in the TibcoIncident Table to check if this substation is available in the table 'Medical Case' and then count the number of affected customers from that table and then display the number of the measure in card.
Now my issue is I am unable to find a way to do it, my current formula (Below) will do it perfectly when I select a record from the table but will not count automatically for records, I think because I am using SelectedValue function so is there any way to do my requirment ?
Just to note that my common column in the 2 tables is substation number
Solved! Go to Solution.
@Zakhamido
Please try this meaure:
MatchedAccounts =
SUMX (
ADDCOLUMNS (
TIBCOINCIDENT_UPDATED,
"__DCount",
VAR CurrentSubName = TIBCOINCIDENT_UPDATED[SUB_NAME]
VAR CurrentStatus = TIBCOINCIDENT_UPDATED[STATUS]
VAR CurrentOutageTime = TIBCOINCIDENT_UPDATED[Outage_Time_UAE]
VAR CurrentTime =
NOW ()
RETURN
IF (
CurrentStatus = "Un-Planned Pending"
&& CurrentOutageTime > CurrentTime - 24,
CALCULATE (
DISTINCTCOUNT ( 'Medical Case'[Per Src Id] ),
'Medical Case'[Substation] = CurrentSubName
)
) + 0
),
[__DCount]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks a lot
@Zakhamido
Could you paste the DAX measure in the reply rather than the image so I can modify it for you?
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Zakhamido
Please try this meaure:
MatchedAccounts =
SUMX (
ADDCOLUMNS (
TIBCOINCIDENT_UPDATED,
"__DCount",
VAR CurrentSubName = TIBCOINCIDENT_UPDATED[SUB_NAME]
VAR CurrentStatus = TIBCOINCIDENT_UPDATED[STATUS]
VAR CurrentOutageTime = TIBCOINCIDENT_UPDATED[Outage_Time_UAE]
VAR CurrentTime =
NOW ()
RETURN
IF (
CurrentStatus = "Un-Planned Pending"
&& CurrentOutageTime > CurrentTime - 24,
CALCULATE (
DISTINCTCOUNT ( 'Medical Case'[Per Src Id] ),
'Medical Case'[Substation] = CurrentSubName
)
) + 0
),
[__DCount]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |