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
Anonymous
Not applicable

Creating a measure as a Calculated Column

Hi PowerBI guys,

 

I have scatter graph with 3 variables - x, y (x and y are irrelvant to the question) with the size determined by a calculated measure.

The scatter graph is also grouped at the detail of a Member Surname.

 

Power BI v2.PNG

 

 

I have then asked for conditional formatting to be applied, based on the Open Agreement measure. The colours are grouped  into 3 buckets - less than 20, 20 to 80, and 80+ using conditional formatting:

 
Power BI.PNG
 
Everything looks good so far, but the problem is i would like to show these traffic lights as a legend in my graph.
 
From what i understand, in order to show this as a legend, i would need to have a calculated column in the "legend" section, with these rules implemented. However I cannot build a calculated column from a measure, as measures happen last in processing.
 
 
Open_Agreements = CALCULATE(
COUNT(DimMatter[DimMatter_Key]),
FILTER(Agreements, Agreements[Last_End_Result_Date] = blank())
)
 
 
What i've tried (this does not produce the right stats)
 
MOH_Status =
COUNTAX(

FILTER(
GROUPBY(Agreements,Agreements[Max_Allocated_Party]),
Agreements[Last_End_Result_Date] = blank()
),
Agreements[DimMatter_Key] )
 
Does anyone have any ideas?
 
Thanks
 
Oneiricer
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous,

 

Here is the next step as you described. Please follow the link below and revert me if any concern.

 

Here you go: https://drive.google.com/file/d/1KwNAty0ncy9GG0QbWw2fylQHX8GeW6rW/view?usp=sharing

 

 

Best Regards,

Ravi

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous,

 

I have created a pbix by taking random data on your problem. I am attaching PBIX file go through it and revert me if any concern.

Here the link:  https://drive.google.com/file/d/1kNjmFrpBK39IT5Mc9HiceT2-H8BCrXcz/view?usp=sharing

 

Best Regards,

Ravi

Anonymous
Not applicable

Hi Ravi


Thanks for responding back so quickly. This is very close, but what i'm after is something like this:

 

Power BI v3.PNG

Does a count against "Name" and sees how many are blank per person.

 

The next step (which i can do) is 1 = red, 2 = green, for example.

Anonymous
Not applicable

...

Anonymous
Not applicable

Hi  @Anonymous,

 

Here is the next step as you described. Please follow the link below and revert me if any concern.

 

Here you go: https://drive.google.com/file/d/1KwNAty0ncy9GG0QbWw2fylQHX8GeW6rW/view?usp=sharing

 

 

Best Regards,

Ravi

Anonymous
Not applicable

Thanks a lot. Works fine for me.

 

Is there a way to have a single DAX code as a solution, instead of creating a secondary table via summarize?

 

 

 

Anonymous
Not applicable

Yes There is way but Creating summarize table is much reliable. Though you can write SQL I mean to say that if you calculate count calculation in database then import in power bi then just you have to drag and drop in power bi.
😊

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.