cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sohan
Helper III
Helper III

How to use measure in bar chart

I have the following table:

Sohan_0-1626866422664.png

 

Column patientnumber is Converted (Unique)[patientnumber]

Column First date by client has the following DAX code: 

First Date by client = 
CALCULATE(MIN('Geconverteerd (Uniek)'[Datum afspraak]),
    ALLEXCEPT('Geconverteerd (Uniek)', 'Geconverteerd (Uniek)'[Patiëntnummer]))

 

Column First employee has the following DAX code:

First Employee = 
VAR vFirstDate = [First Date by client]
RETURN
CALCULATE(
    MIN('Geconverteerd (Uniek)'[Gebruiker]),
    ALLEXCEPT(
        'Geconverteerd (Uniek)',
        'Geconverteerd (Uniek)'[Patiëntnummer]
    ),
    'Geconverteerd (Uniek)'[Datum afspraak] = vFirstDate
)

 

How can I make the table into a calculated table, so I can use it in charts?

1 ACCEPTED SOLUTION

@Sohan , I need  sample data and sample output in table format? 

 

Try this a new table 

addcolumns(summarize(Table,'Geconverteerd (Uniek)', 'Geconverteerd (Uniek)'[paitentnumber]) ,

"First Date by client" ,[First Date by client], "First Employee" ,[First Employee] )

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Sohan , Above two, are columns?

If not those can me.  and you should be able to use them in visual

 

if not

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak the above two are measures, not calculated columns. I want the image table to be a calculated table, so I can use the data in a visual. 

 

Column 1 (column from calculated table) = Converted (unique) [patient number]

Column 2 = measure with code as above

Column 3 = measure with code as above

@Sohan , I need  sample data and sample output in table format? 

 

Try this a new table 

addcolumns(summarize(Table,'Geconverteerd (Uniek)', 'Geconverteerd (Uniek)'[paitentnumber]) ,

"First Date by client" ,[First Date by client], "First Employee" ,[First Employee] )

Helpful resources

Announcements
Winner of T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

Top Solution Authors